java.lang.IllegalStateException: No compose hierarchies found in the app. Possible reasons include: (1) the Activity that calls setContent did not launch; (2) setContent was not called; (3) setContent was called before the ComposeTestRule ran. If setContent is called by the Activity, make sure the Activity is launched after the ComposeTestRule runs at androidx.compose.ui.test.TestContext.getAllSemanticsNodes$ui_test_release(TestOwner.kt:86) at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNodes$ui_test_release(SemanticsNodeInteraction.kt:62) at androidx.compose.ui.test.SemanticsNodeInteraction.fetchOneOrDie(SemanticsNodeInteraction.kt:128) at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNode(SemanticsNodeInteraction.kt:79) at androidx.compose.ui.test.TextActionsKt.getNodeAndFocus(TextActions.kt:108) at androidx.compose.ui.test.TextActionsKt.getNodeAndFocus$default(TextActions.kt:105) at androidx.compose.ui.test.TextActionsKt.performTextInput(TextActions.kt:42) at com.example.tiptime.TipUITests.calculate_20_percent_tip(TipUITests.kt:43)
$ git clone https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator.git $ cd basic-android-kotlin-compose-training-tip-calculator $ git checkout test_solution
run TipUITests Failed:
java.lang.IllegalStateException: No compose hierarchies found in the app. Possible reasons include: (1) the Activity that calls setContent did not launch; (2) setContent was not called; (3) setContent was called before the ComposeTestRule ran. If setContent is called by the Activity, make sure the Activity is launched after the ComposeTestRule runs at androidx.compose.ui.test.TestContext.getAllSemanticsNodes$ui_test_release(TestOwner.kt:86) at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNodes$ui_test_release(SemanticsNodeInteraction.kt:62) at androidx.compose.ui.test.SemanticsNodeInteraction.fetchOneOrDie(SemanticsNodeInteraction.kt:128) at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNode(SemanticsNodeInteraction.kt:79) at androidx.compose.ui.test.TextActionsKt.getNodeAndFocus(TextActions.kt:108) at androidx.compose.ui.test.TextActionsKt.getNodeAndFocus$default(TextActions.kt:105) at androidx.compose.ui.test.TextActionsKt.performTextInput(TextActions.kt:42) at com.example.tiptime.TipUITests.calculate_20_percent_tip(TipUITests.kt:43)