https://kotlinlang.org logo
#compose-android
Title
# compose-android
a

Albert Chang

11/14/2023, 5:57 AM
After I upgraded compose to latest alpha, all host-side tests that are using
mutableStateOf
started to fail with
java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked
thrown in
androidx.compose.runtime.ActualAndroid_androidKt.<clinit>
. While I understand the motivation of the change, I'm wondering if it makes sense to make
MainThreadId
fallback to -1 gracefully so that the user don't have to update every test or use
unitTests.returnDefaultValues = true
, since this is a really common use case.
Okay never mind. Seems that it's already fixed but not yet released.
a

ascii

11/14/2023, 6:22 AM
Am I reading it wrong? Isn't this fix included in the latest Compose Compiler release?
CL is from Oct 19
a

Albert Chang

11/14/2023, 6:23 AM
It's Compose Runtime.
a

ascii

11/14/2023, 6:23 AM
of course, my bad
4 Views