Google Fabric: UiAutomation not connected
Asked Answered
N

4

53

After deployment of an app to Google Play Beta I see next issue in Crashlytics (6 - 7 users are affected)

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)

It seems that it's google test devices. Any ideas about fix?

Naaman answered 17/12, 2017 at 11:39 Comment(7)
We contacted Fabric support two days ago, no answer for now ...Naaman
any news on this one? Same here. Thanks.Ambitendency
nothing new, they do not answerNaaman
same here , any news ?Antrim
Some update, engineer form Firebase responded to our mail, they look to the issueNaaman
I am seeing the same thing. Mine too look like Google test devices. Are you able to confirm the crashes don't exist outside of the Beta. i.e Final release?Soule
The Google sample code seems to have the same issue given the open issue on the repo : github.com/googlesamples/android-testing/issues/89Soule
P
6

It seems that this crash is related to UI testing in your app. If you don't have any UI testing and there are only default settings which added automatically during creating the project, you should remove from your build.gradle the line testInstrumentationRunner in defaultConfig

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

and androidTestCompile, testCompile in dependencies

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'
...
Passbook answered 13/1, 2018 at 19:17 Comment(4)
what about if u have tests o.O :DWaffle
Indeed what if you do have tests? I'm not convinced this will occur to average users as in their case the instrumentation runner should not be invoked. I believe its confined to Google test devices, I would like confirmation on this though...Soule
I removed those lines but still get that exception reported in productionBurge
I don't have any of those lines in build.gradle, but I'm starting to see the issue.Seow
B
29

It seems like nothing to worry about (don't rely on accepted answer and don't remove your tests) because crashes have been reported on creating pre-launch report for google play store where some UI automation tests were executed. If you track devices on which this error has occurred then you'll see that all paths lead to pre-launch report.

You can find out more about pre-launch report here

Bridewell answered 22/2, 2019 at 9:40 Comment(0)
P
6

It seems that this crash is related to UI testing in your app. If you don't have any UI testing and there are only default settings which added automatically during creating the project, you should remove from your build.gradle the line testInstrumentationRunner in defaultConfig

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

and androidTestCompile, testCompile in dependencies

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'
...
Passbook answered 13/1, 2018 at 19:17 Comment(4)
what about if u have tests o.O :DWaffle
Indeed what if you do have tests? I'm not convinced this will occur to average users as in their case the instrumentation runner should not be invoked. I believe its confined to Google test devices, I would like confirmation on this though...Soule
I removed those lines but still get that exception reported in productionBurge
I don't have any of those lines in build.gradle, but I'm starting to see the issue.Seow
M
1

One thing is sure: you have an issue on UI. In most cases this occurs when you show a progress dialog that keeps being displayed for too much time. In this case the Google crawler goes in timeout and raises an exception. My advice is: be sure to not block UI with infinite dialogs.

Martial answered 7/3, 2019 at 16:37 Comment(0)
E
1

The funny thing is that I get this crash while my app is being tested by google before publishing. I really don't know what google team is doing.

Exoskeleton answered 7/12, 2019 at 20:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.