使用 UiAutomation 出现 UiAutomation connect 失败的问题,请问有哪位大神遇到过的吗
mInstrumentation = InstrumentationRegistry.getInstrumentation();
mDevice = UiDevice.getInstance(mInstrumentation);
报错:
AndroidRuntime: FATAL EXCEPTION: Instr: android.support.test.runner.AndroidJUnitRunner
Process: com.xgd.mytest, PID: 22079
java.lang.IllegalStateException: Cannot call disconnect() while connecting UiAutomation@40bc56a[id=-1, flags=0]
at android.app.UiAutomation.disconnect(UiAutomation.java:293)
at android.app.Instrumentation.finish(Instrumentation.java:249)
at android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:351)
at android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:404)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:393)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205) 文章源自玩技e族-https://www.playezu.com/181970.html
广东省清远市 2F
楼主找到答案了吗
未知地区 1F
build.gradle 没有配置对吧,你去 github 上抄一下官方的代码