react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Getting a crash after some hours of use in Android
Your Environment
- Plugin version: 4.6.0
- Platform: Android
- OS version: Android 11
- Device manufacturer / model: Blackview BV5900
- React Native version (
react-native -v): 0.62.3 (we tried an update also to 0.67.3) - Plugin config
BackgroundGeolocation.ready({
// permissions
locationAuthorizationRequest: 'Always',
// Geolocation Config
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 5, // The minimum distance (measured in meters) a device must move horizontally before an update event is generated.
// Activity Recognition
stopTimeout: 1,
// Application config
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
heartbeatInterval: 30,
stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
startOnBoot: true, // <-- Auto start tracking when device is powered-up.
geofenceModeHighAccuracy: true, // <-- Runs startGeofences with a foreground service (along with its corresponding persitent Notification). This will make geofence triggering far more consistent at the expense of higher power usage.
geofenceProximityRadius: 2000, // <-- Default: 1000. Radius in meters to query for geofences within proximity.
// Aggressive settings
//pausesLocationUpdatesAutomatically: undefined,
locationUpdateInterval: 2000, // Default: 1000. With distanceFilter: 0, Sets the desired interval for location updates, in milliseconds. This setting will be ignored when distanceFilter > 0
fastestLocationUpdateInterval: 1000, //Default: 10000. Explicitly set the fastest interval for location updates, in milliseconds.
//disableElasticity: true,
//disableStopDetection: true,
foregroundService: true,
// SQlite settings
maxRecordsToPersist: 0 //disabled persisting locations
}
Expected Behavior
The app shouldn't crash.
Actual Behavior
The app after about two hours of massive use, crash
Steps to Reproduce
The app adds and removes a geofence each time. It's a guided tour where an user can have a single geofence each time
- the app removes all geofences
- the app adds a single geofence
- the user visits the geofence
- after the visit, the app return to the step 1
Context
The crash is only after 1/3 hours of use. The stack trace isn't very useful here unfortunately so we tried to update/remove/change all the libraries to try to find a possible cause (for example the audio library, etc.). When we removed the geofence used for the geofence, the app isn't crashed but we don't know why.
Debug logs
Logs
05-06 18:08:55.333 19579 19592 I .showbyte.roer: Background young concurrent copying GC freed 11185(693KB) AllocSpace objects, 2(104KB) LOS objects, 0% free, 511MB/512MB, paused 359us total 1.188s
05-06 18:08:55.334 19579 19579 I .showbyte.roer: WaitForGcToComplete blocked Alloc on HeapTrim for 1.182s
05-06 18:08:55.334 19579 19579 I .showbyte.roer: Starting a blocking GC Alloc
05-06 18:08:55.334 19579 19637 I .showbyte.roer: WaitForGcToComplete blocked Alloc on HeapTrim for 1.181s
05-06 18:08:55.334 19579 19637 I .showbyte.roer: Starting a blocking GC Alloc
05-06 18:08:55.334 19579 19841 I .showbyte.roer: WaitForGcToComplete blocked Alloc on HeapTrim for 1.180s
05-06 18:08:55.334 19579 19841 I .showbyte.roer: Starting a blocking GC Alloc
05-06 18:08:55.335 19579 19839 I .showbyte.roer: WaitForGcToComplete blocked Alloc on HeapTrim for 1.151s
05-06 18:08:55.335 19579 19839 I .showbyte.roer: Starting a blocking GC Alloc
05-06 18:08:55.335 19579 19610 I .showbyte.roer: WaitForGcToComplete blocked Alloc on HeapTrim for 688.890ms
05-06 18:08:55.335 19579 19610 I .showbyte.roer: Starting a blocking GC Alloc
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.wix.detox.adapters.server.InvokeActionHandler.handle(DetoxActionHandlers.kt:54)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.wix.detox.adapters.server.ActionsExecutor$executeAction$$inlined$let$lambda$1.run(DetoxActionsDispatcher.kt:64)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Handler.handleCallback(Handler.java:883)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Handler.dispatchMessage(Handler.java:100)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:214)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.wix.detox.adapters.server.ActionsExecutor$1.run(DetoxActionsDispatcher.kt:50)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: detox.secondary (state = RUNNABLE)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.nativePollOnce(Native Method)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.next(MessageQueue.java:336)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:174)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 2 more
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: glide-active-resources (state = WAITING)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Native Method)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Object.java:442)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.bumptech.glide.load.engine.ActiveResources.cleanReferenceQueue(ActiveResources.java:128)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.bumptech.glide.load.engine.ActiveResources$2.run(ActiveResources.java:61)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.bumptech.glide.load.engine.ActiveResources$1$1.run(ActiveResources.java:43)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 1 more
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: glide-disk-cache-thread-0 (state = WAITING)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at sun.misc.Unsafe.park(Native Method)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:548)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: glide-source-thread-0 (state = WAITING)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 9 more
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: glide-source-thread-1 (state = WAITING)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 9 more
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: glide-source-thread-2 (state = WAITING)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 9 more
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: glide-source-thread-3 (state = WAITING)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 9 more
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: mqt_js (state = RUNNABLE)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Handler.handleCallback(Handler.java:883)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Handler.dispatchMessage(Handler.java:100)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:14)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at androidx.test.espresso.base.LooperIdlingResourceInterrogationHandler$2.run(LooperIdlingResourceInterrogationHandler.java:3)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Handler.handleCallback(Handler.java:883)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Handler.dispatchMessage(Handler.java:100)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:214)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: mqt_native_modules (state = RUNNABLE)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at java.lang.StringBuilder.append(StringBuilder.java:137)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:328)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
05-06 18:08:55.335 19579 19637 E DetoxANRHandler: ... 11 more
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: pool-12-thread-1 (state = WAITING)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at sun.misc.Unsafe.park(Native Method)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: ... 1 more
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: pool-6-thread-1 (state = WAITING)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: ... 8 more
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: pool-7-thread-44 (state = RUNNABLE)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.lang.String.intern(Native Method)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.content.Intent.setAction(Intent.java:8471)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.content.Intent.readFromParcel(Intent.java:10514)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.content.Intent.<init>(Intent.java:10510)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.content.Intent$1.createFromParcel(Intent.java:10501)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.content.Intent$1.createFromParcel(Intent.java:10499)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.app.IActivityManager$Stub$Proxy.registerReceiver(IActivityManager.java:4823)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1528)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1489)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1477)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:627)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.location.TSLocation.updateBatteryLevel(Unknown Source:12)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.location.TSLocation.initialize(Unknown Source:534)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.location.TSLocation.<init>(Unknown Source:25)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.location.TSLocationManager.buildTSLocation(Unknown Source:14)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.location.TSLocationManager.onLocationResult(Unknown Source:297)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.service.TrackingService$a.run(Unknown Source:4)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: ... 2 more
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: queued-work-looper (state = RUNNABLE)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.nativePollOnce(Native Method)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.next(MessageQueue.java:336)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:174)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at android.os.HandlerThread.run(HandlerThread.java:67)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: |ANR-WatchDog| (state = RUNNABLE)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.lang.Thread.sleep(Native Method)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.lang.Thread.sleep(Thread.java:440)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at java.lang.Thread.sleep(Thread.java:356)
05-06 18:08:55.336 19579 19637 E DetoxANRHandler: at io.sentry.android.core.ANRWatchDog.run(ANRWatchDog.java:78)
note: we are using Detox to reproduce the "massive" use os the app and the crash after 2 hours.
at com.transistorsoft.locationmanager.location.TSLocation.updateBatteryLevel
I've never seen this before. It seems this device Blackview BV5900 is failing to provide some expected information when requesting battery status info. I will add guards in addition to a more modern method for requesting battery-info for devices where Build.VERSION.SDK_INT >= Build.VERSION_CODES.O.
@christocracy we had the same problem with another blackview model (it's an app for a future kiosk mode and the blackview smartphones are used to test): BV4900Pro with Android 10
@christocracy I attach some other logs
Logs
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: App nonresnponsive detection!
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: com.github.anrwatchdog.ANRError: Application Not Responding for at least 5000 ms.
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: main (state = BLOCKED)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.BinderProxy.transactNative(Native Method)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.BinderProxy.transact(BinderProxy.java:510)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.app.IAlarmManager$Stub$Proxy.remove(IAlarmManager.java:382)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.app.AlarmManager.cancel(AlarmManager.java:941)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.scheduler.TSScheduleManager.cancelOneShot(Unknown Source:129)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.service.TrackingService.g(Unknown Source:14)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.service.TrackingService.b(Unknown Source:194)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.service.TrackingService.b(Unknown Source:257)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.transistorsoft.locationmanager.service.TrackingService.onStartCommand(Unknown Source:182)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4115)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.app.ActivityThread.access$1900(ActivityThread.java:226)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1916)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.Handler.dispatchMessage(Handler.java:107)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:14)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:8)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at androidx.test.espresso.base.UiControllerImpl.loopMainThreadUntilIdle(UiControllerImpl.java:17)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:2)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:1)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.Handler.handleCallback(Handler.java:883)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.Handler.dispatchMessage(Handler.java:100)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:214)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.app.ActivityThread.main(ActivityThread.java:7389)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.lang.reflect.Method.invoke(Native Method)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: AsyncTask #64 (state = RUNNABLE)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.Binder.flushPendingCommands(Native Method)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.AsyncTask$3.call(AsyncTask.java:379)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: AsyncTask #66 (state = TERMINATED)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at sun.misc.Unsafe.park(Native Method)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: ... 2 more
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: ChoreographerOwner:Handler (state = RUNNABLE)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.nativePollOnce(Native Method)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.next(MessageQueue.java:336)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:174)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at android.os.HandlerThread.run(HandlerThread.java:67)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: ConnectivityThread (state = RUNNABLE)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: ... 4 more
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: Espresso Key Event #0 (state = WAITING)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at sun.misc.Unsafe.park(Native Method)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
05-06 18:10:09.339 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
05-06 18:10:09.341 19579 19579 D QueuedWork: waited: [<1: 0, <2: 22, <4: 3, <8: 15, <16: 2873, <32: 276, <64: 19, <128: 31, <256: 5, <512: 1, <1024: 1, <2048: 10, <4096: 0, <8192: 5, <16384: 0, >=16384: 0]
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: ExoPlayerImplInternal:Handler (state = RUNNABLE)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.nativePollOnce(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.next(MessageQueue.java:336)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:174)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.HandlerThread.run(HandlerThread.java:67)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: FileObserver (state = RUNNABLE)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.FileObserver$ObserverThread.observe(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.FileObserver$ObserverThread.run(FileObserver.java:113)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: FinalizerDaemon (state = WAITING)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Object.java:442)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:271)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Daemons$Daemon.run(Daemons.java:137)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: FinalizerWatchdogDaemon (state = WAITING)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.sleep(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.sleep(Thread.java:440)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.sleep(Thread.java:356)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Daemons$FinalizerWatchdogDaemon.sleepForMillis(Daemons.java:383)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:411)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:323)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: ... 2 more
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: FrameMetricsAggregator (state = RUNNABLE)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.nativePollOnce(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.next(MessageQueue.java:336)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:174)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at android.os.HandlerThread.run(HandlerThread.java:67)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: GoogleApiHandler (state = RUNNABLE)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: ... 4 more
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: HybridData DestructorThread (state = WAITING)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Object.java:442)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at com.facebook.jni.DestructorThread$1.run(DestructorThread.java:76)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: Instr: androidx.test.runner.AndroidJUnitRunner (state = WAITING)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Object.wait(Object.java:442)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.join(Thread.java:1422)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.Thread.join(Thread.java:1503)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at com.wix.detox.adapters.server.ActionsExecutor.join(DetoxActionsDispatcher.kt:78)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at com.wix.detox.adapters.server.DetoxActionsDispatcher.join(DetoxActionsDispatcher.kt:33)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at com.wix.detox.DetoxMain.run(DetoxMain.kt:26)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at com.wix.detox.Detox.runTests(Detox.java:200)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at com.wix.detox.Detox.runTests(Detox.java:128)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at it.showbyte.roero.DetoxTest.runDetoxTests(DetoxTest.java:33)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at java.lang.reflect.Method.invoke(Native Method)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:549)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at org.junit.rules.RunRules.evaluate(RunRules.java:20)
05-06 18:10:09.341 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:162)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.Suite.runChild(Suite.java:128)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.Suite.runChild(Suite.java:27)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:444)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2196)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: InstrumentationConnectionThread (state = RUNNABLE)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.nativePollOnce(Native Method)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at android.os.MessageQueue.next(MessageQueue.java:336)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at android.os.Looper.loop(Looper.java:174)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at android.os.HandlerThread.run(HandlerThread.java:67)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: Loader:ExtractorMediaPeriod (state = WAITING)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at sun.misc.Unsafe.park(Native Method)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.lang.Thread.run(Thread.java:919)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: OkHttp ConnectionPool (state = TIMED_WAITING)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at sun.misc.Unsafe.park(Native Method)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2109)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: ... 3 more
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: OkHttp TaskRunner (state = TIMED_WAITING)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at okhttp3.internal.ws.RealWebSocket.writeOneFrame$okhttp(RealWebSocket.kt:489)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at okhttp3.internal.ws.RealWebSocket$WriterTask.runOnce(RealWebSocket.kt:620)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at okhttp3.internal.concurrent.TaskRunner.runTask(TaskRunner.kt:116)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at okhttp3.internal.concurrent.TaskRunner.access$runTask(TaskRunner.kt:42)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:65)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: ... 2 more
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: OkHttp http://localhost:54949/... (state = RUNNABLE)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.net.SocketInputStream.socketRead0(Native Method)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.net.SocketInputStream.socketRead(SocketInputStream.java:119)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.net.SocketInputStream.read(SocketInputStream.java:176)
05-06 18:10:09.348 19579 19637 E DetoxANRHandler: at java.net.SocketInputStream.read(SocketInputStream.java:144)
05-06 18:10:09.349 19579 19841 I .showbyte.roer: Waiting for a blocking GC Alloc
05-06 18:10:09.349 19579 19839 I .showbyte.roer: Waiting for a blocking GC Alloc
05-06 18:10:09.349 19579 19637 I .showbyte.roer: Waiting for a blocking GC Alloc
05-06 18:10:09.349 19579 8910 I .showbyte.roer: Waiting for a blocking GC Alloc
05-06 18:10:09.349 19579 27045 I .showbyte.roer: Waiting for a blocking GC Alloc
05-06 18:10:09.352 19579 19579 I .showbyte.roer: Waiting for a blocking GC Alloc
Are you a customer? I don't see you are a member of the private repo, where this code update will land first.
@christocracy I'm anadvisor for a customer who bought the license; their username is showbyte
ANR Application Not Responding for at least 5000 ms. is a common problem in general for Android developers and foreground-services. The plugin does everything it can to minimize usage of the main-thread during application launch.
Everything else must be addressed within your own code. You address these issues by implementing Android StrictMode and observing logcat for StrictMode Violations.
The SampleApp deployed to Play Store hasn't received any ANR in the past 60 days.
It looks like your usage of Detox is concealing an ANR caused by something like #976
@showbyte no longer has access to the private repo since their support subscription expired.
thanks a lot for the reply 🙇♂️ with the strict mode that you often suggested there aren't useful details
05-06 18:12:53.487 19917 19997 D StrictMode: StrictMode policy violation: android.os.strictmode.CustomViolation: gcore.dynamite
We look for new debug details
in late 2019, I added significant protection within the plugin's src to ensure the plugin does not block the main thread. Search the CHANGELOG for the words "Context.startForeground"
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. You may also mark this issue as a "discussion" and I will leave this open.