{"action":"created","issue":{"url":"https://api.github.com/repos/openatx/uiautomator2/issues/222","repository_url":"https://api.github.com/repos/openatx/uiautomator2","labels_url":"https://api.github.com/repos/openatx/uiautomator2/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/openatx/uiautomator2/issues/222/comments","events_url":"https://api.github.com/repos/openatx/uiautomator2/issues/222/events","html_url":"https://github.com/openatx/uiautomator2/issues/222","id":361768384,"node_id":"MDU6SXNzdWUzNjE3NjgzODQ=","number":222,"title":"app crashes with IntentReceiverLeaked and IllegalStateException","user":{"login":"gamesguru","id":30691680,"node_id":"MDQ6VXNlcjMwNjkxNjgw","avatar_url":"https://avatars1.githubusercontent.com/u/30691680?v=4","gravatar_id":"","url":"https://api.github.com/users/gamesguru","html_url":"https://github.com/gamesguru","followers_url":"https://api.github.com/users/gamesguru/followers","following_url":"https://api.github.com/users/gamesguru/following{/other_user}","gists_url":"https://api.github.com/users/gamesguru/gists{/gist_id}","starred_url":"https://api.github.com/users/gamesguru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamesguru/subscriptions","organizations_url":"https://api.github.com/users/gamesguru/orgs","repos_url":"https://api.github.com/users/gamesguru/repos","events_url":"https://api.github.com/users/gamesguru/events{/privacy}","received_events_url":"https://api.github.com/users/gamesguru/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-19T14:10:45Z","updated_at":"2018-09-20T22:48:55Z","closed_at":null,"author_association":"NONE","body":"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.\r\n\r\nI found one report of same issue on Appium uiautomator2: https://gist.github.com/vikramvi/829edd8b04f79f186329ad6d80e9f1fe\r\n\r\n```\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: Service com.github.uiautomator.Service has leaked IntentReceiver com.github.uiautomator.monitor.BatteryMonitor$1@94c314a that was originally registered here. Are you missing a call to unregisterReceiver()?\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: android.app.IntentReceiverLeaked: Service com.github.uiautomator.Service has leaked IntentReceiver com.github.uiautomator.monitor.BatteryMonitor$1@94c314a that was originally registered here. Are you missing a call to unregisterReceiver()?\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:918)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:719)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1172)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ContextImpl.registerReceiver(ContextImpl.java:1152)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ContextImpl.registerReceiver(ContextImpl.java:1146)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.content.ContextWrapper.registerReceiver(ContextWrapper.java:554)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat com.github.uiautomator.monitor.BatteryMonitor.register(BatteryMonitor.java:40)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat com.github.uiautomator.monitor.AbstractMonitor.<init>(AbstractMonitor.java:17)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat com.github.uiautomator.monitor.BatteryMonitor.<init>(BatteryMonitor.java:21)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat com.github.uiautomator.Service.onCreate(Service.java:53)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ActivityThread.handleCreateService(ActivityThread.java:2877)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ActivityThread.-wrap4(ActivityThread.java)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.os.Looper.loop(Looper.java:148)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat android.app.ActivityThread.main(ActivityThread.java:5417)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat java.lang.reflect.Method.invoke(Native Method)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)\r\n09-18 21:08:38.987  3926  3926 E ActivityThread: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)\r\n--------- beginning of crash\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: FATAL EXCEPTION: Instr: android.support.test.runner.AndroidJUnitRunner\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: Process: com.github.uiautomator, PID: 3926\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: java.lang.IllegalStateException: UiAutomation not connected!\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.app.UiAutomation.throwIfNotConnectedLocked(UiAutomation.java:971)\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.app.UiAutomation.disconnect(UiAutomation.java:237)\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.app.Instrumentation.finish(Instrumentation.java:199)\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:277)\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:282)\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:271)\r\n09-18 21:08:38.999  3926  3940 E AndroidRuntime: \tat android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)\r\n09-18 21:08:39.008   575  1571 W ActivityManager: Error in app com.github.uiautomator running instrumentation ComponentInfo{com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner}:\r\n09-18 21:08:39.008   575  1571 W ActivityManager:   java.lang.IllegalStateException\r\n09-18 21:08:39.008   575  1571 W ActivityManager:   java.lang.IllegalStateException: UiAutomation not connected!\r\n09-18 21:08:39.009   575  1571 I ActivityManager: Force stopping com.github.uiautomator appid=10050 user=0: finished inst\r\n09-18 21:08:39.009   575   720 W ActivityManager: Error shutting down UiAutomationConnection\r\n09-18 21:08:39.012   575  1571 I ActivityManager: Killing 3926:com.github.uiautomator/u0a50 (adj 0): stop com.github.uiautomator\r\n```\r\n\r\nWhat happens on our app after this?  This comes about 10-15 seconds later in the logcat and no idea why.\r\n```\r\n09-18 21:28:15.545  1574  1574 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1574 (com.lci1.one)\r\n09-18 21:28:15.660   162   162 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\r\n09-18 21:28:15.660   162   162 F DEBUG   : Build fingerprint: 'Allwinner/astar_d7/astar-d7:6.0.1/MOB30R/20180917:eng/test-keys'\r\n09-18 21:28:15.660   162   162 F DEBUG   : Revision: '0'\r\n09-18 21:28:15.660   162   162 F DEBUG   : ABI: 'arm'\r\n09-18 21:28:15.660   162   162 F DEBUG   : pid: 1574, tid: 1574, name: com.lci1.one  >>> com.lci1.one <<<\r\n09-18 21:28:15.661   162   162 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------\r\n09-18 21:28:15.770   162   162 F DEBUG   : Abort message: 'art/runtime/indirect_reference_table.cc:65] JNI ERROR (app bug): see above.'\r\n09-18 21:28:15.770   162   162 F DEBUG   :     r0 00000000  r1 00000626  r2 00000006  r3 b6f5bb7c\r\n09-18 21:28:15.770   162   162 F DEBUG   :     r4 b6f5bb84  r5 b6f5bb34  r6 00000002  r7 0000010c\r\n09-18 21:28:15.770   162   162 F DEBUG   :     r8 b4cbf800  r9 b4cbde44  sl 87af4ddb  fp b4ca3858\r\n09-18 21:28:15.771   162   162 F DEBUG   :     ip 00000006  sp beda9938  lr b6ccbedd  pc b6cce2cc  cpsr 400f0010\r\n```\r\n\r\n0.1.4dev40"},"comment":{"url":"https://api.github.com/repos/openatx/uiautomator2/issues/comments/423358996","html_url":"https://github.com/openatx/uiautomator2/issues/222#issuecomment-423358996","issue_url":"https://api.github.com/repos/openatx/uiautomator2/issues/222","id":423358996,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzM1ODk5Ng==","user":{"login":"gamesguru","id":30691680,"node_id":"MDQ6VXNlcjMwNjkxNjgw","avatar_url":"https://avatars1.githubusercontent.com/u/30691680?v=4","gravatar_id":"","url":"https://api.github.com/users/gamesguru","html_url":"https://github.com/gamesguru","followers_url":"https://api.github.com/users/gamesguru/followers","following_url":"https://api.github.com/users/gamesguru/following{/other_user}","gists_url":"https://api.github.com/users/gamesguru/gists{/gist_id}","starred_url":"https://api.github.com/users/gamesguru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamesguru/subscriptions","organizations_url":"https://api.github.com/users/gamesguru/orgs","repos_url":"https://api.github.com/users/gamesguru/repos","events_url":"https://api.github.com/users/gamesguru/events{/privacy}","received_events_url":"https://api.github.com/users/gamesguru/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T22:48:55Z","updated_at":"2018-09-20T22:48:55Z","author_association":"NONE","body":"Allwinner astar-d7 tablet v6.0rc3, 6.0.1/MOB30R.. sun8i/armeabi-v7a"}}
{"actor":{"display_login":"gamesguru"}}