gpt4 book ai didi

android - Espresso 测试错误 : AppNotIdleException

转载 作者:IT王子 更新时间:2023-10-28 23:32:41 34 4
gpt4 key购买 nike

我关闭了开发者选项中的所有动画。但是当我尝试单击其中一个按钮时,我仍然会遇到此异常。

我的应用确实处于 Activity 状态,并非完全处于空闲状态,但我无法更改它。

android.support.test.espresso.AppNotIdleException: Looped for 6930
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.doPerform(ViewInteraction.java:115)
at android.support.test.espresso.ViewInteraction.perform(ViewInteraction.java:87)

最佳答案

过去几天我一直在努力解决这个问题。
这是我用来识别“违规者”的一种方法:

private void dumpThreads() {
int activeCount = Thread.activeCount();
Thread[] threads = new Thread[activeCount];
Thread.enumerate(threads);
for (Thread thread : threads) {
System.err.println(thread.getName() + ": " + thread.getState());
for (StackTraceElement stackTraceElement : thread.getStackTrace()) {
System.err.println("\t" + stackTraceElement);
}
}
}

在我的例子中,Facebook SDK 使用的是 AsyncTask 线程池。

关于android - Espresso 测试错误 : AppNotIdleException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38856136/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com