Getting `java.lang.ClassCastException: androidx.co...
# compose
t
Getting
java.lang.ClassCastException: androidx.compose.ui.platform.ParcelableMutableStateHolder cannot be cast to androidx.compose.runtime.MutableState
after 1.0.0-beta02 when using
rememberSaveable
without custom saver, full stacktrace in thread
👍 1
j
The fix was supposed to be in beta02 https://issuetracker.google.com/issues/180042685 Perhaps what we’re seeing is unrelated?
t
not sure if it is related, I can create a minimal sample
step to reproduce: 1. scroll and select some item, and keep some selected item in the screen 2. lock the phone for a while 3. unlock the phone 4. scroll, and it will crash with the exception it might happen randomly but I can reproduce the error for the most times.
a
🎉 1
@Tlaster I can’t reproduce it unfortunately. Can I ask you to provide more details as a comment in the bug? Do you also use compose-navigation? maybe you can share more code
t
No, I'm not using compose-navigation, I've just start an empty compose project with beta02 and kotlin 1.4.31 then use the code above, it still happens
Just record a video that reproduce the issue
And here is the minimal sample source code I'm using https://github.com/Tlaster/rememberSaveable-crash-sample
a
ok, I managed to reproduce. thanks again!
🎉 1
Was able to find the issue. This will be fixed in next beta. Workarounds from https://issuetracker.google.com/issues/180042685#comment4 or https://issuetracker.google.com/issues/180042685#comment7 should work here as well