I just got an interesting exception on my Galaxy Nexus while doing the
usual change-compile-debug cycle with Eclipse:

01-21 02:19:03.340 E/AndroidRuntime(  667): FATAL EXCEPTION: main
01-21 02:19:03.340 E/AndroidRuntime(  667): java.lang.RuntimeException:
Unable to instantiate application
org.kman.AquaMail.core.AquaMailApplication: java.lang.NullPointerException
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.LoadedApk.makeApplication(LoadedApk.java:482)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:3909)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.ActivityThread.access$1300(ActivityThread.java:122)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1184)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.os.Looper.loop(Looper.java:137)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.ActivityThread.main(ActivityThread.java:4340)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
java.lang.reflect.Method.invokeNative(Native Method)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
java.lang.reflect.Method.invoke(Method.java:511)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
dalvik.system.NativeStart.main(Native Method)
01-21 02:19:03.340 E/AndroidRuntime(  667): Caused by:
java.lang.NullPointerException
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
01-21 02:19:03.340 E/AndroidRuntime(  667): at
android.app.LoadedApk.makeApplication(LoadedApk.java:474)
01-21 02:19:03.340 E/AndroidRuntime(  667): ... 11 more

The app was on the screen, and then, while it was being reinstalled after a
source change, I briefly saw the "app stopped unexpectedly" dialog flash on
the screen, and the above appeared in the logcat.

Occasionally my Market console or users report weird errors which go away
after reinstalling the same .apk, and I remember others sharing similar
experiences on this list as well.

The exception above may be related - it seems that Andorid tried to do
something with the application while the .apk was being installed.

I've never seen this before, but thread race bugs -- if that's what's
behind this -- happen much more frequently on multicore hardware. They can
still happen on single-core systems, although less frequently - which may
explain corrupted applications when you get above a certain number of
installations.

This is the line that crashed:

https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/LoadedApk.java#L362

... implying that pm.getPackageInfo() for the application's package
returned null.

Anyone else seen this?

Any thoughts on investigating this further?

Thanks,
-- Kostya

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

Reply via email to