After updating Kotlin to 2.2.0, my autotest started failing on the start screen with the following error in Espresso class on compose view:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
However, my autotest does not use any indexing operations. and this issue is not related to the UI. I also noticed that the application now loads more slowly. As a result, the autotest begins its checks before the app is fully loaded. Previously, this wasn’t a problem—the test would pass thanks to the built-in waits. text error:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at androidx.test.espresso.Espresso.onIdle(Espresso.java:357)
at androidx.test.espresso.Espresso.onIdle(Espresso.java:378)
at androidx.compose.ui.test.EspressoLink_androidKt.runEspressoOnIdle(EspressoLink.android.kt:88)
at androidx.compose.ui.test.EspressoLink.runUntilIdle(EspressoLink.android.kt:82)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.waitForIdle(ComposeUiTest.android.kt:596)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$waitForIdle(ComposeUiTest.android.kt:391)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidTestOwner.getRoots(ComposeUiTest.android.kt:822)
at androidx.compose.ui.test.TestOwnerKt.getAllSemanticsNodes(TestOwner.kt:81)
at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNodes$ui_test_release(SemanticsNodeInteraction.kt:64)
at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNodes$ui_test_release$default(SemanticsNodeInteraction.kt:59)
at androidx.compose.ui.test.AndroidAssertions_androidKt.checkIsDisplayed(AndroidAssertions.android.kt:29)
at androidx.compose.ui.test.AssertionsKt.isDisplayed(Assertions.kt:351)
at androidx.compose.ui.test.AssertionsKt.assertIsDisplayed(Assertions.kt:33)
at io.github.kakaocup.compose.node.assertion.NodeAssertions$assertIsDisplayed$1.invoke(NodeAssertions.kt:13)
at io.github.kakaocup.compose.node.assertion.NodeAssertions$assertIsDisplayed$1.invoke(NodeAssertions.kt:13)
.......
@get:Rule val rule = createComposeRule(StandardTestDispatcher()))