Google Fabric:UiAutomation未连接

问题描述 投票:41回答:3

将应用程序部署到Google Play Beta后,我在Crashlytics中看到了下一期(6 - 7位用户受到影响)

Fatal Exception: java.lang.IllegalStateException: UiAutomation not connected!
   at android.app.UiAutomation.throwIfNotConnectedLocked(UiAutomation.java:971)
   at android.app.UiAutomation.disconnect(UiAutomation.java:237)
   at android.app.Instrumentation.finish(Instrumentation.java:222)
   at android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:351)
   at android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:405)
   at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:394)
   at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1960)

它似乎是谷歌测试设备。关于修复的任何想法?

android crashlytics google-fabric
3个回答
6
投票

似乎此崩溃与您的应用中的UI测试有关。如果您没有任何UI测试,并且只有在创建项目期间自动添加的默认设置,您应该从build.gradle中删除defaultConfig中的testInstrumentationRunner行

  defaultConfig {
   ....
   testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
} 

和androidTestCompile,依赖的testCompile

dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
...

13
投票

似乎没有什么可担心的(不要依赖于已接受的答案,也不要删除您的测试;))因为已经报告了为执行某些UI自动化测试的Google Play商店创建发布前报告的崩溃。如果您跟踪发生此错误的设备,您会看到所有路径都会导致发布前报告。

您可以找到有关发布前报告here的更多信息


-1
投票

有一件事是肯定的:你在UI上遇到了问题。在大多数情况下,当您显示持续显示太长时间的进度对话框时会发生这种情况。在这种情况下,Google抓取工具进入超时状态并引发异常。我的建议是:确保不要使用无限对话框阻止UI。

© www.soinside.com 2019 - 2024. All rights reserved.