5

I am continuously getting this error when I land on a page. What could be the solution to this?

android.support.test.espresso.AppNotIdleException: Looped for 4539 iterations over 60 SECONDS. The following Idle Conditions failed .
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:92)
at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:56)
at android.support.test.espresso.ViewInteraction.runSynchronouslyOnUiThread(ViewInteraction.java:184)
at android.support.test.espresso.ViewInteraction.check(ViewInteraction.java:158)
Emil Sierżęga
  • 1,785
  • 2
  • 31
  • 38
San Kh
  • 175
  • 1
  • 3
  • 10

2 Answers2

8

It might occur due to any UI element which is creating itself infinitely. For example, you have a Custom ProgressBar or Snackbar which is set to invisible/gone in xml and you are setting it visible in java code. But it might re-paint itself in invisible/gone state also due to ill-written code. So, go through any Custom UI elements as well if you have any.

Apurva Sharma
  • 191
  • 2
  • 7
  • 15
    This was the problem for me (invalidate() accidentally getting called on loop). To help diagnose this problem, you can enable Developer Options > Show Surface Updates. Offending views will flash very rapidly. – Bob Liberatore Sep 06 '17 at 19:32
  • Yes...this is the way to diagnose the issue. – Apurva Sharma Sep 08 '17 at 04:22
2

It's very likely because you didn't turn off the following 3 settings in you developer options:

  • Window animation scale
  • Transition animation scale
  • Animator duration scale

For more informations read the tips to set up Espresso.

If that is not the case something seems to be interacting with your screen while the test is running.

luckyhandler
  • 10,651
  • 3
  • 47
  • 64