Closed gamesguru closed 3 months ago
Got a related logcat "cannot call disconnect() while connecting!"
09-19 09:17:58.520 1381 1402 E AndroidRuntime: Process: com.github.uiautomator, PID: 1381
09-19 09:17:58.520 1381 1402 E AndroidRuntime: java.lang.IllegalStateException: Cannot call disconnect() while connecting!
09-19 09:17:58.520 1381 1402 E AndroidRuntime: at android.app.UiAutomation.disconnect(UiAutomation.java:225)
09-19 09:17:58.520 1381 1402 E AndroidRuntime: at android.app.Instrumentation.finish(Instrumentation.java:193)
09-19 09:17:58.520 1381 1402 E AndroidRuntime: at android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:277)
09-19 09:17:58.520 1381 1402 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:282)
09-19 09:17:58.520 1381 1402 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:271)
09-19 09:17:58.520 1381 1402 E AndroidRuntime: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
09-19 09:17:58.530 440 739 W ActivityManager: Error in app com.github.uiautomator running instrumentation ComponentInfo{com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner}:
09-19 09:17:58.530 440 739 W ActivityManager: java.lang.IllegalStateException
09-19 09:17:58.530 440 739 W ActivityManager: java.lang.IllegalStateException: Cannot call disconnect() while connecting!
09-19 09:17:58.530 1381 1381 E ActivityThread: Service com.github.uiautomator.Service has leaked IntentReceiver com.github.uiautomator.monitor.BatteryMonitor$1@418eb678 that was originally registered here. Are you missing a call to unregisterReceiver()?
09-19 09:17:58.530 1381 1381 E ActivityThread: android.app.IntentReceiverLeaked: Service com.github.uiautomator.Service has leaked IntentReceiver com.github.uiautomator.monitor.BatteryMonitor$1@418eb678 that was originally registered here. Are you missing a call to unregisterReceiver()?
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:810)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:606)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1430)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1410)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1404)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:467)
09-19 09:17:58.530 1381 1381 E ActivityThread: at com.github.uiautomator.monitor.BatteryMonitor.register(BatteryMonitor.java:40)
09-19 09:17:58.530 1381 1381 E ActivityThread: at com.github.uiautomator.monitor.AbstractMonitor.<init>(AbstractMonitor.java:17)
09-19 09:17:58.530 1381 1381 E ActivityThread: at com.github.uiautomator.monitor.BatteryMonitor.<init>(BatteryMonitor.java:21)
09-19 09:17:58.530 1381 1381 E ActivityThread: at com.github.uiautomator.Service.onCreate(Service.java:53)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ActivityThread.handleCreateService(ActivityThread.java:2572)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ActivityThread.access$1800(ActivityThread.java:135)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.os.Handler.dispatchMessage(Handler.java:102)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.os.Looper.loop(Looper.java:136)
09-19 09:17:58.530 1381 1381 E ActivityThread: at android.app.ActivityThread.main(ActivityThread.java:5017)
09-19 09:17:58.530 1381 1381 E ActivityThread: at java.lang.reflect.Method.invokeNative(Native Method)
09-19 09:17:58.530 1381 1381 E ActivityThread: at java.lang.reflect.Method.invoke(Method.java:515)
09-19 09:17:58.530 1381 1381 E ActivityThread: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
09-19 09:17:58.530 1381 1381 E ActivityThread: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
09-19 09:17:58.530 1381 1381 E ActivityThread: at dalvik.system.NativeStart.main(Native Method)
09-19 09:17:58.550 440 739 I ActivityManager: Force stopping com.github.uiautomator appid=10057 user=0: finished inst
09-19 09:17:58.550 440 739 I ActivityManager: Killing 1381:com.github.uiautomator/u0a57 (adj 0): stop com.github.uiautomator```
报下具体的手机型号
Allwinner astar_d7-eng tablet v6.0rc3, 6.0.1/MOB30R.. sun8i/armeabi-v7a
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The battery monitor has removed
Uiautomation keeps working. Our app is crashing after this, and I'm not sure it is our app just crashing or something wrong with uiautomation.
I found one report of same issue on Appium uiautomator2: https://gist.github.com/vikramvi/829edd8b04f79f186329ad6d80e9f1fe
What happens on our app after this? This comes about 10-15 seconds later in the logcat and no idea why.
0.1.4dev40