5

One or two of my users experience the above class not found run time exception when trying to run my app.

How can that happen and how can I fix it? Is it a bad install?

Thanks

Paul

Stack trace received through Android Publishers site. I cannot replicate this myself. (com.android.app.app.app) is the name of the app/activity as defined in the manifest.

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{my,app.app.app/com.android.app.app.app}: java.lang.ClassNotFoundException: com.android.app.app.app in loader dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-1/pkg.apk] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753) at android.app.ActivityThread.access$2500(ActivityThread.java:129) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4701) 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.android.app.app.app in loader dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-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:1021) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2651) ... 11 more

smith324
  • 13,020
  • 9
  • 37
  • 58
Paul S
  • 269
  • 2
  • 11
  • Some more info will be useful. – Mudassir Mar 30 '11 at 08:48
  • Like what? Surely a class not found run time exception either happens 100% or not at all? – Paul S Mar 30 '11 at 08:49
  • Like, the use of any third party API, native code, or anything else you suspect can cause such exception. – Mudassir Mar 30 '11 at 08:51
  • java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{my,app.app.app/com.android.app.app.app}: java.lang.ClassNotFoundException: com.android.app.app.app in loader dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-1/pkg.apk] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659) – Paul S Mar 30 '11 at 09:00
  • I use jni, but the point is, how can this happen, either the class exists or it doesnt right? I don't understand how it may or may not be there unless Google are maybe allowing users to download apps their devices can't handle? – Paul S Mar 30 '11 at 09:01
  • Is your app using any device specific hardware resource? – Mudassir Mar 30 '11 at 09:02
  • I wouldn't say device specific, but it requests the use Of GPS, accelerometer and touch screen, these are marked as such in the manifest file. Shouldn't Android market filter those devices out though? I appreciate your help. – Paul S Mar 30 '11 at 09:13
  • 1
    @Paul S: Consider posting a complete real stack trace. There is no `com.android.app.app.app package` in Android, unless some hardware manufacturer put one there. – CommonsWare Mar 30 '11 at 11:06
  • I changed the name as this is the package name of the app/activity. Nothing untoward there. I guess that would suggest a complete failure of installation? With regards to a full stack trace, how would I do that with the limited amount of characters you can enter on this site? – Paul S Mar 30 '11 at 11:20
  • I've seen this stack trace before in my Error's console for an app on the Market. – Blundell Mar 30 '11 at 11:41
  • @Blundell: Did you manage to resolve it? – Paul S Mar 30 '11 at 12:00
  • @Paul No i didn't :-( it was my class that extended Application, and the app was on their SD card at the time. But I haven't seen it again since. It could of been he got a glitch in his download stream. – Blundell Mar 30 '11 at 12:13
  • Yeh, looks like one of those problems you just can't catch as it's the main activity class. Still, I would prefer not to receive a bad rating for a problem out of my control but I digress. Thanks all. – Paul S Mar 30 '11 at 12:37
  • +1 Data Point for another app that has seen such an error. – Anm May 04 '11 at 22:39
  • what version of android is the stack trace? – Robby Pond May 06 '11 at 13:39

1 Answers1

2

I'd check to see if these users are installing the app on an SD card: if the app is installed the app icon might be visible in the application list (since that is stored on-device) but if the SD card is unavailable (removed or maybe mounted for reading by a PC over USB) when the user taps the application icon the attempts to load will fail. You will notice:

ComponentInfo{my,app.app.app/com.android.app.app.app}: java.lang.ClassNotFoundException: com.android.app.app.app in loader dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-1/pkg.apk] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659) at 

in your stack trace above: is /mnt/asec the SD card storage path on the device?

Femi
  • 64,273
  • 8
  • 118
  • 148
  • Hi Femi, Looking at http://androidforums.com/droid-all-things-root/192356-apps2sd-location.html It appears /mnt/asec is where encrypted virtual drives are stored containing the package when storing it on the SD card. Still, how to catch the exception? – Paul S Jun 01 '11 at 10:48
  • You can't catch the exception: your code is not present on the device at all, so you can't catch it. If the SD card is mounted over USB or removed then none of your code is currently available. Tell the user they can't remove the SD/mount the SD and use the app at the same time. – Femi Jun 01 '11 at 13:35
  • Femi, thats what I thought. Nice of Android to blame the app for something it can do absolutely nothing about. Thanks for your help. – Paul S Jun 23 '11 at 11:50