3
  1. UI Tests on Emulator - ok
  2. Debug on real device - ok
  3. UI Tests on real device - don't start with error:

java.lang.AssertionError: Activity never becomes requested state "[STARTED, CREATED, RESUMED, DESTROYED]" (last lifecycle transition = "PRE_ON_CREATE") at androidx.test.core.app.ActivityScenario.waitForActivityToBecomeAnyOf(ActivityScenario.java:338) at androidx.test.core.app.ActivityScenario.launchInternal(ActivityScenario.java:272) at androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:195) .....

@LargeTest @RunWith(AndroidJUnit4ClassRunner::class) .....

ActivityScenario.launch(SplashActivity::class.java)

2 Answers2

0

Allow the "display pop-up windows while running in the background permission" or something similar to that. It worked for me on a Redmi Note 8 device

Michael Omaka
  • 11
  • 1
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 16 '22 at 19:49
0

On Flyme (Meizu phones), you should allow run in background for .test app in Security app: Run in background allowed image

mxkmn
  • 79
  • 1
  • 6