Hi,

I have an application that's on Android Market with >10,000 users. Every
once in while (once or twice a week), I am getting a ClassNotFoundException
on the Market Developer Console for my main activity:


java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.mycompany.myapp/com.mycompany.myapp.MainActivity}:
java.lang.ClassNotFoundException: com.mycompany.myapp.MainActivity in loader
dalvik.system.PathClassLoader[/mnt/asec/com.mycompany.myapp-1/pkg.apk]
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2757)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2866)
at android.app.ActivityThread.access$2300(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2181)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:5097)
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.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException:
com.mycompany.myapp.MainActivity in loader
dalvik.system.PathClassLoader[/mnt/asec/com.mycompany.myapp-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newActivity(Instrumentation.java:1034)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2749)
... 11 more


Note that this application is in production and used by > 10,000 people and
MainActivity is the very first activity during startup. This error happens
very rarely, but yet it happens. I couldn't reproduce it on my developer
phone nor the emulator, so I ended up adding a default application that's
extended from Application and called before my main activity, but this time
I got the same exception for my Application class:

java.lang.RuntimeException: Unable to instantiate application
com.mycompany.myapp.App: java.lang.ClassNotFoundException:
com.mycompany.myapp.App in loader
dalvik.system.PathClassLoader[/mnt/asec/com.mycompany.myapp-1/pkg.apk]
at
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)
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.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.mycompany.myapp.App in
loader
dalvik.system.PathClassLoader[/mnt/asec/com.mycompany.myapp-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newApplication(Instrumentation.java:942)
at
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)
... 11 more


This application is installed to SD Card by default and my guess is that it
might be SD Card related, so I tried to mount/unmount my SD Card to
reproduce it and still no luck. I am really puzzled at this point and trying
to find out if anyone has suggestions. ClassNotFoundException is thrown when
the app package does not contain a required class, but that's not the case
for my app. Please help :)


Thank you,


-Vega

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to