android.os.BadParcelableException: ClassNotFoundException when unmarshalling
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.routeyou.startup/com.routeyou.ui.DownloadRouteActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294) at android.app.ActivityThread.access$1000(ActivityThread.java:210) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState at android.os.Parcel.readParcelableCreator(Parcel.java:2295) at android.os.Parcel.readParcelable(Parcel.java:2245) at android.view.AbsSavedState.<init>(AbsSavedState.java:57) at android.view.View$BaseSavedState.<init>(View.java:21487) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init>(TextRoundCornerProgressBar.java:318) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init>(TextRoundCornerProgressBar.java:306) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel(TextRoundCornerProgressBar.java:340) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel(TextRoundCornerProgressBar.java:338) at android.os.Parcel.readParcelable(Parcel.java:2252) at android.os.Parcel.readValue(Parcel.java:2152) at android.os.Parcel.readSparseArrayInternal(Parcel.java:2546) at android.os.Parcel.readSparseArray(Parcel.java:1874) at android.os.Parcel.readValue(Parcel.java:2209) at android.os.Parcel.readArrayMapInternal(Parcel.java:2485) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.Bundle.getSparseParcelableArray(Bundle.java:822) at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2290) at android.app.Activity.onRestoreInstanceState(Activity.java:1170) at android.app.Activity.performRestoreInstanceState(Activity.java:1115) at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1190) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3157) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294) at android.app.ActivityThread.access$1000(ActivityThread.java:210) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
same here . i think we should switch to another view
anyone found a fix for this?
Same problem.
Same problem. I think i need to looking for an alternative library.
I have the same problem, anyone has a solution??
@leof23 I haven't find any solutions. I'm just slowly switching the use of that view in my project for a new one.
@luizfp do you know another good alternative for this component?
@leof23 I don't know any alternatives that are so customizable.
I make one myself using something like this:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/spacing_small"
android:layout_marginRight="@dimen/spacing_small"
android:background="@color/dark_gray"
android:orientation="horizontal"
android:padding="1.7dp">
<ImageView
android:id="@+id/img_progress"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@color/blue"
android:padding="@dimen/spacing_tiny"
android:src="@drawable/ic_hourglass_white" />
<LinearLayout
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@color/dark_gray" />
</LinearLayout>
It's easy to make your own custom view using this simple layout.
With this approach we don't have much control but this fits my needs. One thing is not so easy to reproduce: radius effect. But I can live without this.
@akexorcist Please look at this issue, if possible.
any news on this?
My users keep reporting the BadParcelableException but it's not due to unmarshalling
Caused by: android.os.BadParcelableException:
at android.os.Parcel.readParcelableCreator (Parcel.java:2536)
at android.os.Parcel.readParcelable (Parcel.java:2462)
at android.view.AbsSavedState.<init> (AbsSavedState.java:67)
at android.view.View$BaseSavedState.<init> (View.java:22764)
at android.view.View$BaseSavedState.<init> (View.java:22753)
at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState.<init> (IconRoundCornerProgressBar.java:314)
at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState.<init> (IconRoundCornerProgressBar.java:297)
at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState$1.createFromParcel (IconRoundCornerProgressBar.java:346)
at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState$1.createFromParcel (IconRoundCornerProgressBar.java:344)
at android.os.Parcel.readParcelable (Parcel.java:2471)
at android.os.Parcel.readValue (Parcel.java:2365)
at android.os.Parcel.readSparseArrayInternal (Parcel.java:2813)
at android.os.Parcel.readSparseArray (Parcel.java:2068)
at android.os.Parcel.readValue (Parcel.java:2422)
at android.os.Parcel.readArrayMapInternal (Parcel.java:2732)
at android.os.BaseBundle.unparcel (BaseBundle.java:269)
at android.os.Bundle.getSparseParcelableArray (Bundle.java:934)
at com.android.internal.policy.PhoneWindow.restoreHierarchyState (PhoneWindow.java:2109)
at android.app.Activity.onRestoreInstanceState (Activity.java:1060)
at android.app.Activity.performRestoreInstanceState (Activity.java:1015)
at android.app.Instrumentation.callActivityOnRestoreInstanceState (Instrumentation.java:1178)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2670)
I create a very simple Progress Bar sample (not a library) in alternative to this beautiful library with this bad bug. If same one is interested : https://github.com/rcaboni/TestCustomProgress
For those desperately needing a fix... here's the dirty one I found :( I inlined all BaseRoundCornerProgressBar into the derived class
For example, instead of public class IconRoundCornerProgressBar extends BaseRoundCornerProgressBar you need public class IconRoundCornerProgressBar extends LinearLayout and put all method/properties of BaseRoundCornerProgressBar into IconRoundCornerProgressBar
Find attach a special version... I created a IconTextRoundCornerProgressBar (both Icon and Text features) You can have a look at it here
For those desperately needing a fix... here's the dirty one I found :( I inlined all BaseRoundCornerProgressBar into the derived class
For example, instead of public class IconRoundCornerProgressBar extends BaseRoundCornerProgressBar you need public class IconRoundCornerProgressBar extends LinearLayout and put all method/properties of BaseRoundCornerProgressBar into IconRoundCornerProgressBar
Find attach a special version... I created a IconTextRoundCornerProgressBar (both Icon and Text features) You can have a look at it here
Great. It is working. Thank you @CedricCarniel . I would like to know, What is the issue ? Why it is working, If we combine the files ?
Same here
Hey guy
Sorry for huge issue from my library but I can't reproduce this bug.
It will be great, If anyone can provide more information to reproduce it.
@antonlookinpoynt Can you?
Hello, @akexorcist
Steps to reproduce the issue
- Run the app and navigate to the screen which shows the progress bar.
- Put the app in the background
- Kill the app using the "Terminates selected Android Application" option from the Android Studio logcat
- Reopen the app using the recents screen
A lot of users are facing this issue. It would be helpful if you can solve and provide an update to the library. Thanks in advance :)
Good news everyone. I finally fixed it.
It's hard to dig up the problem causing. Because there's no one create custom view with class inheritance like this.
The common solution the save state of custom view doesn't works with these kind of custom view implementation. To solved this, I replace Creator with Parcelable.ClassLoaderCreator and replace BaseSavedState with AbsSavedState. Those class will support the save state for view hierarchy.
@mehul4795 Your steps description is very helpful. Thank you so much.
See you in v2.1.1.
2.1.1 is out with issue fixed.
Feel free to reopen this issue if it still happen.
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.routeyou.startup/com.routeyou.ui.DownloadRouteActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294) at android.app.ActivityThread.access$1000(ActivityThread.java:210) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState at android.os.Parcel.readParcelableCreator(Parcel.java:2295) at android.os.Parcel.readParcelable(Parcel.java:2245) at android.view.AbsSavedState.<init>(AbsSavedState.java:57) at android.view.View$BaseSavedState.<init>(View.java:21487) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init>(TextRoundCornerProgressBar.java:318) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init>(TextRoundCornerProgressBar.java:306) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel(TextRoundCornerProgressBar.java:340) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel(TextRoundCornerProgressBar.java:338) at android.os.Parcel.readParcelable(Parcel.java:2252) at android.os.Parcel.readValue(Parcel.java:2152) at android.os.Parcel.readSparseArrayInternal(Parcel.java:2546) at android.os.Parcel.readSparseArray(Parcel.java:1874) at android.os.Parcel.readValue(Parcel.java:2209) at android.os.Parcel.readArrayMapInternal(Parcel.java:2485) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.Bundle.getSparseParcelableArray(Bundle.java:822) at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2290) at android.app.Activity.onRestoreInstanceState(Activity.java:1170) at android.app.Activity.performRestoreInstanceState(Activity.java:1115) at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1190) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3157) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294) at android.app.ActivityThread.access$1000(ActivityThread.java:210) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Hi @akexorcist is this issue fixed ?