Manideep Polireddi
05/10/2022, 5:52 AMjava.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
But we are not able to figure out which part of our source is causing this problem since all of the stacktrace points to android framework, compose runtime and animation library. Full stacktrace in the 🧵
Note: the crash is intermittent and we are able to reproduce it a few times, when the app is changing orientation from landscape back to portrait.
Can anyone help us figure out how we can get to the root cause for this crash?AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: com.disneyplus.mea, PID: 17381
AndroidRuntime: java.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
AndroidRuntime: at androidx.compose.runtime.snapshots.SnapshotKt.readError(Snapshot.kt:1646)
AndroidRuntime: at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1641)
AndroidRuntime: at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1632)
AndroidRuntime: at androidx.compose.runtime.SnapshotMutableStateImpl.getValue(SnapshotState.kt:130)
AndroidRuntime: at androidx.compose.animation.core.AnimationScope.isRunning(AnimationState.kt:337)
AndroidRuntime: at androidx.compose.animation.core.SuspendAnimationKt.animate(SuspendAnimation.kt:260)
AndroidRuntime: at androidx.compose.animation.core.SuspendAnimationKt$animate$4.invokeSuspend(Unknown Source:17)
AndroidRuntime: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
AndroidRuntime: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
AndroidRuntime: at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
AndroidRuntime: at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
AndroidRuntime: at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:68)
AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1278)
AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:1019)
AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:907)
AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1248)
AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:900)
AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:103)
AndroidRuntime: at android.os.Looper.loop(Looper.java:219)
AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8668)
AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
Zach Klippenstein (he/him) [MOD]
05/10/2022, 3:18 PMManideep Polireddi
05/10/2022, 3:27 PMtheapache64
05/11/2022, 7:48 AMZach Klippenstein (he/him) [MOD]
05/24/2022, 5:37 PMtheapache64
05/24/2022, 5:46 PMZach Klippenstein (he/him) [MOD]
05/24/2022, 5:46 PMtheapache64
05/24/2022, 5:46 PMZach Klippenstein (he/him) [MOD]
05/24/2022, 5:51 PManimate
? Is it being called from a thread other than the main one?Ale Stamato
05/24/2022, 6:01 PMtheapache64
05/25/2022, 4:15 AMHow is the code that triggers this calling@Zach Klippenstein (he/him) [MOD] No. All UI stuffs (like animation) or update? Is it being called from a thread other than the main one?animate
State
are on main thread. We double checked this.Zach Klippenstein (he/him) [MOD]
05/25/2022, 3:09 PMManideep Polireddi
05/25/2022, 3:11 PMZach Klippenstein (he/him) [MOD]
05/25/2022, 4:07 PMManideep Polireddi
05/25/2022, 4:08 PMtheapache64
05/25/2022, 4:32 PM1.2.0-beta01
too. Confirmed.1.2.0-beta01
),
Fatal Exception: java.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
at androidx.compose.runtime.snapshots.SnapshotKt.readError(Snapshot.kt:1826)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1821)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1812)
at androidx.compose.runtime.SnapshotMutableStateImpl.getValue(SnapshotState.kt:130)
at androidx.compose.animation.core.AnimationScope.isRunning(AnimationScope.java:337)
at androidx.compose.animation.core.SuspendAnimationKt.animate(SuspendAnimation.kt:260)
at androidx.compose.animation.core.SuspendAnimationKt$animate$4.invokeSuspend(SuspendAnimation.kt:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Zach Klippenstein (he/him) [MOD]
05/25/2022, 4:55 PMtheapache64
05/25/2022, 4:56 PM