https://kotlinlang.org logo
#compose
Title
# compose
p

Philip Blandford

08/29/2020, 9:42 AM
Is anyone seeing this error:
Caused by: 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:1495)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1491)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1482)
at androidx.compose.runtime.SnapshotMutableState.getValue(MutableState.kt:294)
...then my code
It's happening pretty randomly, in code WAY down in my base layers that has absolutely nothing to do with Compose, and at expressions that are very simple and shouldn't fail (one example is just creating a Fraction instance from the apache library).
z

Zach Klippenstein (he/him) [MOD]

08/29/2020, 9:46 AM
m

manueldidonna

08/29/2020, 10:19 AM
If you're using
launchInComposition
in any of these crashes, check my old thread. Thanks to @Chuck Jazdzewski [G] and @Adam Powell that bug has been already fixed. Here you can find a workaround to use until the next compose release
a

Adam Powell

08/29/2020, 1:50 PM
Thanks to the schedule of our build cuts, the fix is probably going to be in the release after the next one
3 Views