AndroidX.Test ActivityScenario: java.lang.AssertionError: Activity never becomes requested state “[RESUMED]” (last lifecycle transition = “STOPPED”)

前端 未结 3 870
旧时难觅i
旧时难觅i 2021-01-19 02:01

ActivityScenario is a replacement of ActivityController in Robolectric and ActivityTestRule in ATSL.

When refactoring from ATSL to Andro

3条回答
  •  庸人自扰
    2021-01-19 03:01

    For me this was because I had a device plugged in with the screen off and an emulator running. I assumed I was launching to the emulator but I was running it on the device. Since the screen was off, the test was never able to transition to a valid state.

提交回复
热议问题