Code Droid
Code Droid

Reputation: 10472

Runtime Exception Unable to instantiate application class not found in loader?

Following is Error Log I am getting,

java.lang.RuntimeException: Unable to instantiate application
com.test.MyApplication: java.lang.ClassNotFoundException:
com.test.MyApplication in loader
dalvik.system.PathClassLoader[/mnt/asec/com.test-1/pkg.apk]  at
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:659)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4201)
at android.app.ActivityThread.access$3000(ActivityThread.java:125)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)  at
android.os.Looper.loop(Looper.java:123)  at
android.app.ActivityThread.main(ActivityThread.java:4627)  at
java.lang.reflect.Method.invokeNative(Native Method)  at
java.lang.reflect.Method.invoke(Method.java:521)  at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.j…

Upvotes: 0

Views: 1578

Answers (2)

Swifty McSwifterton
Swifty McSwifterton

Reputation: 2667

I would imagine that the class "MyApplication" extends Application. Sooo...what you most likely forgot to do was this:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:name="MyApplication" >

You need to define your custom Application class in the AndroidManifest. I would bet this will fix your problem.

Upvotes: 0

Ralph Pina
Ralph Pina

Reputation: 761

That's just saying it can't find that class. Make sure the name and package are correct.

Then go to Project > Clean.. and clean/rebuild your application.

It might also make it easier for others to help if you paste the code for that Activity.

Upvotes: 1

Related Questions