Since the change to version "beta03" I get the fol...
# compose
m
Since the change to version "beta03" I get the following error message when I try to animate an Animatable with animateTo in a suspend function.
Copy code
exception: java.lang.IllegalStateException: A MonotonicFrameClock is not available in this CoroutineContext. Callers should supply an appropriate MonotonicFrameClock using withContext.
How can I give the context the appropriate clock?
a
Run your animation in a coroutine scope obtained from the composition. Usually this means something that originated from a
LaunchedEffect
or
rememberCoroutineScope()
.
m
@Adam Powell Thanks for the hint
👍 1
c
I had this same error @Maik; in my case the problem was that I was using
GlobalScope
in order to expand a bottom sheet and instead I should be using:
Copy code
val coroutineScope = rememberCoroutineScope()