Skip to content

1.7.0-Beta: NoSuchMethodError: void kotlinx.coroutines.test.TestBuildersKt.runTest$default(kotlinx.coroutines.test.TestScope, long, kotlin.jvm.functions.Function2, int, java.lang.Object) #3673

@alexvanyo

Description

@alexvanyo

Describe the bug

When updating a project to use kotlinx.coroutines 1.7.0-Beta, existing tests fail with a NoSuchMethodError for a runTest that's being called internally by the Compose test utilities.

The full stack trace looks like the following (but fail for every Compose test):

com.alexvanyo.composelife.resourcestate.ResourceStateComposableTests > collect_as_state_is_correct FAILED
    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:342)
        at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withTestCoroutines(ComposeUiTest.android.kt:218)
        at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1.invoke(ComposeUiTest.android.kt:294)
        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:293)
        at androidx.compose.ui.test.junit4.IdlingResourceRegistry.withRegistry(IdlingResourceRegistry.jvm.kt:157)
        at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1.invoke(ComposeUiTest.android.kt:292)
        at androidx.compose.ui.test.junit4.ComposeRootRegistry.withRegistry(ComposeRootRegistry.android.kt:146)
        at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:291)
        at androidx.compose.ui.test.ComposeUiTest_androidKt.runAndroidComposeUiTest(ComposeUiTest.android.kt:107)
        at androidx.compose.ui.test.ComposeUiTest_androidKt.runComposeUiTest(ComposeUiTest.android.kt:63)
        at com.alexvanyo.composelife.resourcestate.ResourceStateComposableTests.collect_as_state_is_correct(ResourceStateComposableTests.kt:39)

Provide a Reproducer

Reproducing PR: alexvanyo/composelife#838

It looks like the update to runTest in 1.7.0-Beta might not have been binary compatible?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions