Monday, July 15, 2013

[android-developers] Google Play services lib crashing with: java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks

HELP: we are getting this error in large numbers from customers since releasing an update which adds Google Play services achievements to our game. Any ideas would be very appreciated. This error crashes the app.

There are minor variations in the stack traces but they are all a "android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks" exception. The most common trace starts from android.app.Application.onConfigurationChanged(), we also get some from android.app.Application.onLowMemory(). Both those are methods in the Interface http://developer.android.com/reference/android/content/ComponentCallbacks.html.

I'm not sure what's happening but one guess is that Google Play services is registering an instance of com.google.android.gms.common.images.e (whatever that is) as if it is a ComponentCallbacks, then when the OS calls a method on that instance the class cast exception is triggered. The crash seems to occur when the app has just been paused, or has not been active for some time; these may be the first times any method in ComponentCallbacks is called.

We use android.gms.common.images.ImageManager to load achievement images in our app; it's the same package, so possibly related (then again, maybe not :)

  4.1.2 stack trace:    21:02:00.411 Exception "main": java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks android.app.Application.onConfigurationChanged(Application.java:99)  hm  java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks  	at android.app.Application.onConfigurationChanged(Application.java:99)  	at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:3653)  	at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:3792)  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337)  	at android.os.Handler.dispatchMessage(Handler.java:99)  	at android.os.Looper.loop(Looper.java:137)  	at android.app.ActivityThread.main(ActivityThread.java:4918)  	at java.lang.reflect.Method.invokeNative(Native Method)  	at java.lang.reflect.Method.invoke(Method.java:511)  	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)  	at dalvik.system.NativeStart.main(Native Method)      4.0.4 stack trace:    
21:18:37.459 Exception "main": java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks android.app.Application.onConfigurationChanged(Application.java:90)  hm  java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks  	at android.app.Application.onConfigurationChanged(Application.java:90)  	at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:3461)  	at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:3585)  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1220)  	at android.os.Handler.dispatchMessage(Handler.java:99)  	at android.os.Looper.loop(Looper.java:137)  	at android.app.ActivityThread.main(ActivityThread.java:4424)  	at java.lang.reflect.Method.invokeNative(Native Method)  	at java.lang.reflect.Method.invoke(Method.java:511)  	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)  	at dalvik.system.NativeStart.main(Native Method)
The onLowMemory() variation: 18:00:46.230 Exception "main": java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks android.app.Application.onLowMemory(Application.java:99) hm java.lang.ClassCastException: com.google.android.gms.common.images.e cannot be cast to android.content.ComponentCallbacks at android.app.Application.onLowMemory(Application.java:99) at android.app.ActivityThread.handleLowMemory(ActivityThread.java:3690) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1233) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method)

--
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate