계측 테스트(Instrumentation Test) Error
2024. 1. 23. 19:41ㆍIT/Android
728x90
<오류 내용>
ava.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
<원인>
계측 테스트는 기기를 통한 UI 테스트이므로 기기의 전원이 켜져 있어야 하는데 그렇지 못한 경우.
<해결 방안>
테스트를 실행하기 전, 앱을 실행하여 에뮬레이터(AVD)의 전원을 킨 상태에서 종료 후 다시 테스트 실행.
728x90
'IT > Android' 카테고리의 다른 글
Jetpack Compose - LazyColumn, Legacy icons, Adaptive icons (0) | 2024.01.24 |
---|---|
Jetpack Compose - Layout Practice (0) | 2024.01.24 |
Jetpack Compose - Unit Test, Instrumentation test (0) | 2024.01.23 |
Jetpack Compose - TextField, Stateless, Stateful, Switch, etc (0) | 2024.01.23 |
Jetpack Compose - remember, MutableStateOf (0) | 2024.01.22 |