I've an application in the market and many users have reported that the app is crashing a lot randomly. I'm trying to fix this but cannot fully understand the logs. Here's a extract from the log,
04-16 13:16:32.407 E/AndroidRuntime( 9237): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.tabview.Tabs3}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.featured.FeaturedView}: java.lang.ClassCastException: android.view.AbsSavedState$1
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.os.Handler.dispatchMessage(Handler.java:99)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.os.Looper.loop(Looper.java:123)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at java.lang.reflect.Method.invokeNative(Native Method)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at java.lang.reflect.Method.invoke(Method.java:521)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at dalvik.system.NativeStart.main(Native Method)
04-16 13:16:32.407 E/AndroidRuntime( 9237): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.featured.FeaturedView}: java.lang.ClassCastException: android.view.AbsSavedState$1
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2335)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:648)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost.setCurrentTab(TabHost.java:320)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.CustomTabHost.setCurrentTab(CustomTabHost.java:43)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost.addTab(TabHost.java:213)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.Tabs3.doCreateTabs(Tabs3.java:180)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.Tabs3.onCreate(Tabs3.java:149)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-16 13:16:32.407 E/AndroidRuntime( 9237): ... 11 more
04-16 13:16:32.407 E/AndroidRuntime( 9237): Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.AbsSpinner.onRestoreInstanceState(AbsSpinner.java:440)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.View.dispatchRestoreInstanceState(View.java:5940)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:1140)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:767)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.View.restoreHierarchyState(View.java:5919)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1454)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Activity.onRestoreInstanceState(Activity.java:835)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Activity.performRestoreInstanceState(Activity.java:807)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096)
04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2473)
04-16 13:16:32.407 E/AndroidRuntime( 9237): ... 22 more
I got this log from one of my users.
Any help on this would be very very helpful.
Regards, Hari
I was finally able to replicate this issue through an emulator set up with 50MB memory and running on GSM network speed. The issue seems to be because of history being cleared and so the data being lost which the app was already having. Not sure how I can handle this though.. any help???
Introduction. ClassCastException is a runtime exception raised in Java when we try to improperly cast a class from one type to another. It's thrown to indicate that the code has attempted to cast an object to a related class, but of which it is not an instance.
Class ClassCastException Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. For example, the following code generates a ClassCastException : Object x = new Integer(0); System.
To prevent the ClassCastException exception, one should be careful when casting objects to a specific class or interface and ensure that the target type is a child of the source type, and that the actual object is an instance of that type.
ClassCast Exception is thrown when we try to cast an object of the parent class to the child class object. However, it can also be thrown when we try to convert the objects of two individual classes that don't have any relationship between them.
My guess is that:
android:id
values among some of the widgets in those activities (fatal)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With