I’ve recently upgrade Eclipse to the Juno release and every thing seemed to be working. After a few weeks (now) I needed to work on the Android app, so I reinstalled the ADT plugin. It required the update of a few related things in the external Android SDK directory. After that things seemed fine.
But as soon as I started the app, both in the emulator and on a test device, the app crashes.
09-10 14:55:14.879: I/ActivityManager(1571): Start proc nl.reinders.android.inventoryapp for activity nl.reinders.android.inventoryapp/.MainMenu: pid=5890 uid=10027 gids={3001, 3002, 3003}
09-10 14:55:14.999: W/dalvikvm(5890): Unable to resolve superclass of Lnl/reinders/android/inventoryapp/MyApplication; (239)
09-10 14:55:14.999: W/dalvikvm(5890): Link of class 'Lnl/reinders/android/inventoryapp/MyApplication;' failed
09-10 14:55:15.009: W/dalvikvm(5890): threadid=1: thread exiting with uncaught exception (group=0x40018560)
09-10 14:55:15.009: E/AndroidRuntime(5890): FATAL EXCEPTION: main
09-10 14:55:15.009: E/AndroidRuntime(5890): java.lang.RuntimeException: Unable to instantiate application nl.reinders.android.inventoryapp.MyApplication: java.lang.ClassNotFoundException: nl.reinders.android.inventoryapp.MyApplication in loader dalvik.system.PathClassLoader[/data/app/nl.reinders.android.inventoryapp-2.apk]
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.LoadedApk.makeApplication(LoadedApk.java:466)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3264)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.ActivityThread.access$2200(ActivityThread.java:117)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.os.Handler.dispatchMessage(Handler.java:99)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.os.Looper.loop(Looper.java:123)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.ActivityThread.main(ActivityThread.java:3729)
09-10 14:55:15.009: E/AndroidRuntime(5890): at java.lang.reflect.Method.invokeNative(Native Method)
09-10 14:55:15.009: E/AndroidRuntime(5890): at java.lang.reflect.Method.invoke(Method.java:507)
09-10 14:55:15.009: E/AndroidRuntime(5890): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
09-10 14:55:15.009: E/AndroidRuntime(5890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)
09-10 14:55:15.009: E/AndroidRuntime(5890): at dalvik.system.NativeStart.main(Native Method)
09-10 14:55:15.009: E/AndroidRuntime(5890): Caused by: java.lang.ClassNotFoundException: nl.reinders.android.inventoryapp.MyApplication in loader dalvik.system.PathClassLoader[/data/app/nl.reinders.android.inventoryapp-2.apk]
09-10 14:55:15.009: E/AndroidRuntime(5890): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
09-10 14:55:15.009: E/AndroidRuntime(5890): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
09-10 14:55:15.009: E/AndroidRuntime(5890): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.Instrumentation.newApplication(Instrumentation.java:942)
09-10 14:55:15.009: E/AndroidRuntime(5890): at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
09-10 14:55:15.009: E/AndroidRuntime(5890): ... 11 more
09-10 14:55:15.019: W/ActivityManager(1571): Force finishing activity nl.reinders.android.inventoryapp/.MainMenu
09-10 14:55:15.529: W/ActivityManager(1571): Activity pause timeout for HistoryRecord{408f7cb0 nl.reinders.android.inventoryapp/.MainMenu}
09-10 14:55:25.649: W/ActivityManager(1571): Activity destroy timeout for HistoryRecord{408f7cb0 nl.reinders.android.inventoryapp/.MainMenu}
Crucial IMHO is that warning “Unable to resolve superclass”, which then results in the class itself not being loaded. Weird is that the class is present in Eclipse, it’s RoboGuice’s Application class (http://code.google.com/p/roboguice/) and its jar is present. I can click it, the class file is opened (unreadable of course, but)…
Coincidentally I still had the old environment (Eclipse Indigo), but it required an update of the ADT plugin because of the upgraded Android SDK, and has the same problem.
Any suggestions why the RoboGuice jar seems to be not included?
With the newer ADT Plug-in, all external ‘jar’ files need to be in the
libs/folder (and you don’t have to reference them from your project… so you can right click > properties > Java Build Path > Libraries and remove the reference to the JAR file)