You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been upgrading the dependencies on this project to test something, and when I upgrade:
Gradle to 7.2.1
Kotlin to 1.6.21
Compose to 1.2.0-beta03
When running the TrackerOverviewE2E tests I get the following error:
com.plcoding.calorytracker.MainActivity@24abf32 has already set content. If you have populated the Activity with a ComposeView, make sure to call setContent on that ComposeView instead of on the test rule; and make sure that that call to setContent {} is done after the ComposeTestRule has run at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.setContent(ComposeUiTest.android.kt:470) at androidx.compose.ui.test.junit4.AndroidComposeTestRule.setContent(AndroidComposeTestRule.android.kt:200) at com.plcoding.calorytracker.TrackerOverviewE2E.setUp(TrackerOverviewE2E.kt:101)
The text was updated successfully, but these errors were encountered:
This is how it can be fixed. Please follow the following steps:
Change the composeRule to the following type. Please replace ... inside <...> by ComponentActivity @get:Rule
val composeRule = createAndroidComposeRule<...>()
Add the following dependency to your app module build.gradle.kts:
debugImplementation("androidx.compose.ui:ui-test-manifest:1.3.0-rc01")
Hello Philipp,
I've really enjoyed this course, congrats.
I've been upgrading the dependencies on this project to test something, and when I upgrade:
Gradle to 7.2.1
Kotlin to 1.6.21
Compose to 1.2.0-beta03
When running the TrackerOverviewE2E tests I get the following error:
com.plcoding.calorytracker.MainActivity@24abf32 has already set content. If you have populated the Activity with a ComposeView, make sure to call setContent on that ComposeView instead of on the test rule; and make sure that that call to
setContent {}is done after the ComposeTestRule has run at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.setContent(ComposeUiTest.android.kt:470) at androidx.compose.ui.test.junit4.AndroidComposeTestRule.setContent(AndroidComposeTestRule.android.kt:200) at com.plcoding.calorytracker.TrackerOverviewE2E.setUp(TrackerOverviewE2E.kt:101)
The text was updated successfully, but these errors were encountered: