Infeasible
Status Update
Comments
ar...@google.com <ar...@google.com> #2
We are not able to reproduce the issue with sample application provided in https://code.google.com/p/android/issues/detail?id=196430 .
Can you provide the below requested information to better understand the issue:
Steps to reproduce
What steps do others need to take in order to reproduce the issue themselves?
Please provide sample application or apk to reproduce the issue.
Also kindly mention the steps we need to follow to reproduce the issue with given sample application or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What do you expect to occur?
Current output
What do you see instead?
Can you provide the below requested information to better understand the issue:
Steps to reproduce
What steps do others need to take in order to reproduce the issue themselves?
Please provide sample application or apk to reproduce the issue.
Also kindly mention the steps we need to follow to reproduce the issue with given sample application or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What do you expect to occur?
Current output
What do you see instead?
wo...@gmail.com <wo...@gmail.com> #3
ar...@google.com <ar...@google.com> #4
We are not able to compile the project given by Hannes Dorfmann in https://code.google.com/p/android/issues/detail?id=196430 .
Please provide sample project to reproduce the issue.
Also kindly mention the steps we need to follow to reproduce the issue with given sample application or apk.
Please provide sample project to reproduce the issue.
Also kindly mention the steps we need to follow to reproduce the issue with given sample application or apk.
ar...@google.com <ar...@google.com> #5
Please provide the information requested in comment #3 to investigate further.
ha...@gmail.com <ha...@gmail.com> #6
Hi,
the sample project compiles on my machine.
Just clone :https://github.com/sockeqwe/mosby.git (master branch)
Then open it in android studio and run sample-mvi or compile it from command line
./gradlew :sample-mvi:assembleDebug
Copy the APK on your device. start the app with "don't keep activity" option. Click on a item on the list to start another Activity, then wait a few seconds to ensure that the previous activity has been destroyed, and then press the back button to come back to the previous Activity which will recreate the Activity and it's fragments and Views. While restoring a this error occurs:
Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v7.widget.Toolbar$SavedState
at android.os.Parcel.readParcelableCreator(Parcel.java:2411)
at android.os.Parcel.readParcelable(Parcel.java:2337)
at android.view.AbsSavedState.<init>(AbsSavedState.java:57)
at android.view.View$BaseSavedState.<init>(View.java:21451)
at com.hannesdorfmann.mosby3.MosbySavedState.<init>(MosbySavedState.java:50)
at com.hannesdorfmann.mosby3.MosbySavedState$1.createFromParcel(MosbySavedState.java:34)
at com.hannesdorfmann.mosby3.MosbySavedState$1.createFromParcel(MosbySavedState.java:32)
at android.os.Parcel.readParcelable(Parcel.java:2346)
at android.os.Parcel.readValue(Parcel.java:2243)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2653)
at android.os.Parcel.readSparseArray(Parcel.java:1946)
at android.os.Parcel.readValue(Parcel.java:2300)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:856)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3384)
at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:120)
at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:378)
at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHo
From my prospective it seems that this is caused by a View which is part of Fragment which is included in XML's layout. It seems that the Fragment doesn't set a ClassLoader internally and therfore it's not able to restore my view's state.
the sample project compiles on my machine.
Just clone :
Then open it in android studio and run sample-mvi or compile it from command line
./gradlew :sample-mvi:assembleDebug
Copy the APK on your device. start the app with "don't keep activity" option. Click on a item on the list to start another Activity, then wait a few seconds to ensure that the previous activity has been destroyed, and then press the back button to come back to the previous Activity which will recreate the Activity and it's fragments and Views. While restoring a this error occurs:
Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v7.widget.Toolbar$SavedState
at android.os.Parcel.readParcelableCreator(Parcel.java:2411)
at android.os.Parcel.readParcelable(Parcel.java:2337)
at android.view.AbsSavedState.<init>(AbsSavedState.java:57)
at android.view.View$BaseSavedState.<init>(View.java:21451)
at com.hannesdorfmann.mosby3.MosbySavedState.<init>(MosbySavedState.java:50)
at com.hannesdorfmann.mosby3.MosbySavedState$1.createFromParcel(MosbySavedState.java:34)
at com.hannesdorfmann.mosby3.MosbySavedState$1.createFromParcel(MosbySavedState.java:32)
at android.os.Parcel.readParcelable(Parcel.java:2346)
at android.os.Parcel.readValue(Parcel.java:2243)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2653)
at android.os.Parcel.readSparseArray(Parcel.java:1946)
at android.os.Parcel.readValue(Parcel.java:2300)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:856)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3384)
at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:120)
at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:378)
at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHo
From my prospective it seems that this is caused by a View which is part of Fragment which is included in XML's layout. It seems that the Fragment doesn't set a ClassLoader internally and therfore it's not able to restore my view's state.
ar...@gmail.com <ar...@gmail.com> #7
Still have same issue
phone_model: GT-I9070
android_version: 2.3.6
'com.android.support:design:25.0.1'
'com.android.support:appcompat-v7:25.0.1'
'com.android.support:cardview-v7:25.0.1'
'com.android.support:recyclerview-v7:25.0.1'
stacktrace:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.design.widget.AppBarLayout$Behavior$SavedState
phone_model: GT-I9070
android_version: 2.3.6
'com.android.support:design:25.0.1'
'com.android.support:appcompat-v7:25.0.1'
'com.android.support:cardview-v7:25.0.1'
'com.android.support:recyclerview-v7:25.0.1'
stacktrace:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.design.widget.AppBarLayout$Behavior$SavedState
kv...@gmail.com <kv...@gmail.com> #8
Still have this issue on Android 5,6.
At this moment we have about 256 crashes of our app because of this issue.
See crashlog in attachments
At this moment we have about 256 crashes of our app because of this issue.
See crashlog in attachments
ha...@gmail.com <ha...@gmail.com> #9
#7 Is the RecyclerView in a Fragment that is embedded in a XML layout (of an Activity)?
[Deleted User] <[Deleted User]> #10
#8 The RecyclerView is in xml-layout file that is inflated by multiple fragments and then added to the ViewPager in MainActivity.
ar...@google.com <ar...@google.com> #11
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
ch...@beyls.net <ch...@beyls.net> #12
This crash is still happening on all API < 13 devices with the latest version of the design support library (25.1.1).
There is indeed a bug in CoordinatorLayout: it does not properly restore its state when the CoordinatorLayout.SavedState constructor is given a null ClassLoader (The ClassLoader argument is always null in API < 13). This can easily be fixed like this:
if (loader == null) {
loader = CoordinatorLayout.class.getClassLoader();
}
Until the bug is fixed, I created a "SafeCoordinatorLayout" which works around the bug and that I'm using as a drop-in replacement of CoordinatorLayout in my projects:
https://gist.github.com/cbeyls/683a90198c64de596ad6502de738a055
There is indeed a bug in CoordinatorLayout: it does not properly restore its state when the CoordinatorLayout.SavedState constructor is given a null ClassLoader (The ClassLoader argument is always null in API < 13). This can easily be fixed like this:
if (loader == null) {
loader = CoordinatorLayout.class.getClassLoader();
}
Until the bug is fixed, I created a "SafeCoordinatorLayout" which works around the bug and that I'm using as a drop-in replacement of CoordinatorLayout in my projects:
ch...@beyls.net <ch...@beyls.net> #13
The bug in that "mosby" sample project is completely unrelated: When you provide a class which inherits from AbsSavedState (like "MosbySavedState"), if the superstate class is not part of the framework (like a custom class), then you need to pass the correct ClassLoader instance to AbsSavedState or it won't be able to inflate the superState.
To fix this, I recommend that "MosbySavedState" inherits from android.support.v4.view.AbsSavedState instead and make sure a non-null ClassLoader is passed to super(). I'll submit a pull request.
To fix this, I recommend that "MosbySavedState" inherits from android.support.v4.view.AbsSavedState instead and make sure a non-null ClassLoader is passed to super(). I'll submit a pull request.
[Deleted User] <[Deleted User]> #14
#11 your SafeCoordinatorLayout is a lifesaver for the older API levels!
ch...@beyls.net <ch...@beyls.net> #15
ar...@google.com <ar...@google.com> #16
Can you please provide a reproduction usecase without the app's(application given in comment #6 ) additional layers of abstraction responsible for parceling state.
ar...@google.com <ar...@google.com> #17
Can you please provide the information requested in comment #16 to investigate further.
ch...@beyls.net <ch...@beyls.net> #18
I created a minimal sample project as reproduction usecase: https://github.com/cbeyls/CoordinatorLayoutStateRestoration
I also provided the fix as pull request and a workaround class for developers, I don't think I can do more than that.
I also provided the fix as pull request and a workaround class for developers, I don't think I can do more than that.
ch...@google.com <ch...@google.com> #19
Note that we're dropping support for <v14 in 26.0.0 so unlikely to release a fix.
Thanks for the investigation though Christophe
Thanks for the investigation though Christophe
ch...@beyls.net <ch...@beyls.net> #20
I was hoping for a final 25.x bugfix release for older devices before their support is dropped. CoordinatorLayout never worked properly on API <13 devices since it was introduced in 2015.
ar...@google.com <ar...@google.com> #21
We no longer target support library for devices less than API 14. Since this bug is only reproducible for those devices, there is nothing we can do about it.
If you can create a minimal project that reproduces it on devices with API 14 and above, we can reopen the bug and fix it.
If you can create a minimal project that reproduces it on devices with API 14 and above, we can reopen the bug and fix it.
Description
The referenced issue is closed because the bug was fixed in an older release. However the bug reappears in the support library 25.x again and there are a lot of comments that are asking for opening the ticket.
But apparently no maintainer is reading closed tickets so I'm opening this to pull the attention there.