Is anyone using Coroutines 1.7.0 with Compose yet?...
# compose-android
k
Is anyone using Coroutines 1.7.0 with Compose yet? The ui-test-junit4 artifact seems to be using some APIs that were removed (stacktrace in thread)
Copy code
'void kotlinx.coroutines.test.TestBuildersKt.runTest$default(kotlinx.coroutines.test.TestScope, long, kotlin.jvm.functions.Function2, int, java.lang.Object)'
java.lang.NoSuchMethodError: 'void kotlinx.coroutines.test.TestBuildersKt.runTest$default(kotlinx.coroutines.test.TestScope, long, kotlin.jvm.functions.Function2, int, java.lang.Object)'
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withTestCoroutines(ComposeUiTest.android.kt:366)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withTestCoroutines(ComposeUiTest.android.kt:228)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1.invoke(ComposeUiTest.android.kt:320)
	at androidx.compose.ui.test.junit4.IdlingStrategy.withStrategy(IdlingStrategy.android.kt:52)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt:319)
	at androidx.compose.ui.test.junit4.IdlingResourceRegistry.withRegistry(IdlingResourceRegistry.jvm.kt:157)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1.invoke(ComposeUiTest.android.kt:318)
	at androidx.compose.ui.test.junit4.ComposeRootRegistry.withRegistry(ComposeRootRegistry.android.kt:146)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:317)
a
Try version 1.7.1 of coroutines instead, it specially restored binary compatibility for the experimental APIs that
runTest
was using: https://github.com/Kotlin/kotlinx.coroutines/issues/3673
k
Thanks! 1.7.1 and Compose 1.4.3 seems to work 🙂 Also, FYI, Compose 1.5.0-beta02 has this error so it needs a later androidx-core than 1.8.0 (looks like we're almost a year behind on that): java.lang.NoClassDefFoundError: androidx/core/view/SoftwareKeyboardControllerCompat at androidx.compose.ui.text.input.InputMethodManagerImpl.<init>(InputMethodManager.kt:57)
a
I don’t believe there is a Compose
1.5.0-beta02
yet? That is indeed a new class first introduced in
androidx.core
1.11.0-alpha04
, but on the latest Compose versions that should be brought in automatically
k
oops..typo. Meant to write beta01. Good to know it's in core 1.11. Thanks 🙂
a
Are you seeing that error when updating to
1.5.0-beta01
?
k
yes...manually switching android-core to 1.11.0-beta01 fixed it. But we're also not using the compose-bom yet.
a
That shouldn’t be necessary, and compose-bom shouldn’t matter in this case. Will investigate this more, thanks for bringing that up!
Is your project Android only or do you have a multiplatform setup?
k
Android only
a
Which Gradle version are you using? Also, if you have a minimal repro project with that issue that’d be helpful as well
k
Gradle 8.0.2. I was just bumping versions in our project...I can see if I can come up w/ a small repro