react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

LocationRequestService ANR on Android 14

Open reinhardholl opened this issue 1 year ago β€’ 10 comments

Your Environment

  • Plugin version: 4.16.5
  • Platform: Android
  • OS version: 14
  • Device manufacturer / model: Samsung A05
  • React Native version (react-native -v): 0.68.2
  • Plugin config
await BackgroundGeolocation.ready({
            reset: true,
            desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
            params: {deviceInfo:deviceInfo,responderId:responderId,responderDeleted:responderDetails?.deleted},
            url: `${environmentConfig.locationsApiHost}/responder/location/${responderId}`,
            autoSync: true,
            distanceFilter: 200,
            autoSyncThreshold: 1,
            maxBatchSize:1,
            disableElasticity: true,
            maxRecordsToPersist:1,
            stationaryRadius: 50,
            batchSync: false,
            disableStopDetection: true,
            pausesLocationUpdatesAutomatically: false,
            headers: {"authorization": `Bearer ${token}`},
            debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
            logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
            stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
            startOnBoot: true,    // <-- Auto start tracking when device is powered-up.
            heartbeatInterval: fiveMinutes,
            disableMotionActivityUpdates: true,
            activityType: BackgroundGeolocation.ACTIVITY_TYPE_AUTOMOTIVE_NAVIGATION,
            preventSuspend: true,
            enableHeadless: true,
            notification:{
                title: "",
                text: "",
                channelName: "TSLocationManager",
                channelId: "com.aura.responder.production.TSLocationManager"
            },
            backgroundPermissionRationale: {
                title: "Allow The Aura responder App to access to this device's location in the background?",
                message: "This app collects location data to enable tracking even when the app is closed or not in use. Please enable always on location permission",
                positiveAction: "Change to always on ",
                negativeAction: "Cancel"
              }
        });

Expected Behavior

Im expecting the app to not ANR while in the foreground.

Actual Behavior

When the app is in the foreground and active I get an ANR after some time. Consistently happening but not clear pattern when.

Context

I am getting ANR's on the LocationRequestService on Android 14 while the app is in the Foreground (ie active). Background tracking is working well. This only started happening after upgrading to 4.16.5. We were on an old version prior to this 4.11.4 so I can't shed light which version introduced this for us. I have hack fixed it by doing this:

<service android:name="com.transistorsoft.locationmanager.service.LocationRequestService"
                 android:foregroundServiceType="location"
                 tools:replace="foregroundServiceType"/>

Not confident that this won't break anything else as it seems that the design of LocationRequestService is to be short lived. Is there anything that we are perhaps doing extending this runtime?

Debug logs

Logs
08-08 09:58:07.201  3944 16789 I TSLocationManager: [c.t.l.http.HttpService flush]
08-08 09:58:07.201  3944 16789 I TSLocationManager:   ℹ️  HttpService is busy
08-08 09:58:07.203  3944  3944 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult]
08-08 09:58:07.203  3944  3944 I TSLocationManager:   πŸ”΅  Acquired current position
08-08 09:58:07.204  3944  3944 D TSLocationManager: [c.t.l.l.TSLocationManager a] Median accuracy: 11.4
08-08 09:58:07.209  3944 16789 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
08-08 09:58:07.209  3944 16789 I TSLocationManager:   βœ…  INSERT: c73a5968-4860-4391-a485-66cfd91e4bc4
08-08 09:58:07.213  3944 16789 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO shrink]
08-08 09:58:07.213  3944 16789 D TSLocationManager:   ℹ️  SHRINK: 1
08-08 09:58:07.217  3944 16789 I TSLocationManager: [c.t.l.http.HttpService flush]
08-08 09:58:07.217  3944 16789 I TSLocationManager:   ℹ️  HttpService is busy
08-08 09:58:07.429  3944 16802 I TSLocationManager: [c.t.l.http.HttpService$f onResponse]
08-08 09:58:07.429  3944 16802 I TSLocationManager:   πŸ”΅  Response: 200
08-08 09:58:07.431  3944 16802 E TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroy]
08-08 09:58:07.431  3944 16802 E TSLocationManager:   ‼️  DESTROY FAILURE: 883bbee4-9648-418b-83c0-8a7124c03490
08-08 09:58:07.435  3944 16802 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO first]
08-08 09:58:07.435  3944 16802 D TSLocationManager:   βœ…  Locked 1 records
08-08 09:58:07.437  3944 16802 I TSLocationManager: [c.t.l.http.HttpService a]
08-08 09:58:07.437  3944 16802 I TSLocationManager:   πŸ”΅  HTTP POST: c73a5968-4860-4391-a485-66cfd91e4bc4
08-08 09:58:07.442  3944 16789 I TSLocationManager: [c.t.locationmanager.rpc.a run] ⚑️[RPC: setConfig: {"distanceFilter":150,"autoSyncThreshold":1,"disableElasticity":true,"maxRecordsToPersist":1,"stationaryRadius":50,"disableStopDetection":true}]
08-08 09:58:07.444  3944 16789 D TSLocationManager: [c.t.l.adapter.TSConfig e] ℹ️   Persist config, dirty: [distanceFilter]
08-08 09:58:07.491  3944  3974 D InputTransport: Input channel destroyed: 'ClientS', fd=165
08-08 09:58:07.494  3944  3974 D InputTransport: Input channel destroyed: 'ClientS', fd=219
08-08 09:58:07.524  3944 16789 I TSLocationManager: [c.t.l.http.HttpService flush]
08-08 09:58:07.524  3944 16789 I TSLocationManager:   ℹ️  HttpService is busy
08-08 09:58:07.614  3944 16837 D TrafficStats: tagSocket(165) with statsTag=0x2710, statsUid=-1
08-08 09:58:07.819  3944 16835 I TSLocationManager: [c.t.l.http.HttpService$f onResponse]
08-08 09:58:07.819  3944 16835 I TSLocationManager:   πŸ”΅  Response: 200
08-08 09:58:07.820  3944 16835 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroy]
08-08 09:58:07.820  3944 16835 D TSLocationManager:   βœ…  DESTROY: c73a5968-4860-4391-a485-66cfd91e4bc4
08-08 09:58:07.821  3944 16835 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 8
08-08 09:58:07.822  3944 16789 I TSLocationManager: [c.t.locationmanager.rpc.a run] ⚑️[RPC: setConfig: {"distanceFilter":150,"autoSyncThreshold":1,"disableElasticity":true,"maxRecordsToPersist":1,"stationaryRadius":50,"disableStopDetection":true}]
08-08 09:58:07.823  3944  4232 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=342703d1-5f9a-42a9-866e-b776e9af945b, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ]
08-08 09:58:09.936  3944  3944 I TSLocationManager: [c.t.l.l.TSLocationManager a]
08-08 09:58:09.936  3944  3944 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 09:58:09.936  3944  3944 I TSLocationManager: β•‘ getCurrentPosition LocationResult: 9 (3919ms old)
08-08 09:58:09.936  3944  3944 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 09:58:09.936  3944  3944 I TSLocationManager: β•Ÿβ”€ πŸ“  Location[fused -25.790858,28.304810 hAcc=2.45 et=+17m58s737ms alt=1423.3999999999999 vAcc=13.8 vel=0.5556085 sAcc=2.6 bear=53.244816 bAcc=156.8], time: 1723103886015
08-08 09:58:09.940  3944  3944 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult]
08-08 09:58:09.940  3944  3944 I TSLocationManager:   πŸ”΅  Acquired current position
08-08 09:58:09.941  3944  3944 D TSLocationManager: [c.t.l.l.TSLocationManager a] Median accuracy: 2.45
08-08 09:58:09.953  3944 16789 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
08-08 09:58:09.953  3944 16789 I TSLocationManager:   βœ…  INSERT: 74276d41-2820-4051-936f-43ce111244ed
08-08 09:58:09.957  3944 16789 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO shrink]
08-08 09:58:09.957  3944 16789 D TSLocationManager:   ℹ️  SHRINK: 1
08-08 09:58:09.962  3944 16789 I TSLocationManager: [c.t.l.http.HttpService flush]
08-08 09:58:09.962  3944 16789 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 09:58:09.962  3944 16789 I TSLocationManager: β•‘ HTTP Service (count: 1)
08-08 09:58:09.962  3944 16789 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 09:58:10.009  3944  3944 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 9
08-08 09:58:10.014  3944 16789 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO first]
08-08 09:58:10.014  3944 16789 D TSLocationManager:   βœ…  Locked 1 records
08-08 09:58:10.015  3944 16789 I TSLocationManager: [c.t.l.http.HttpService a]
08-08 09:58:10.015  3944 16789 I TSLocationManager:   πŸ”΅  HTTP POST: 74276d41-2820-4051-936f-43ce111244ed
08-08 09:58:10.352  3944 16835 I TSLocationManager: [c.t.l.http.HttpService$f onResponse]
08-08 09:58:10.352  3944 16835 I TSLocationManager:   πŸ”΅  Response: 200
08-08 09:58:10.353  3944 16835 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroy]
08-08 09:58:10.353  3944 16835 D TSLocationManager:   βœ…  DESTROY: 74276d41-2820-4051-936f-43ce111244ed
08-08 09:58:10.357  3944 16835 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 9
08-08 09:58:10.358  3944 16789 I TSLocationManager: [c.t.locationmanager.rpc.a run] ⚑️[RPC: setConfig: {"distanceFilter":150,"autoSyncThreshold":1,"disableElasticity":true,"maxRecordsToPersist":1,"stationaryRadius":50,"disableStopDetection":true}]
08-08 09:58:10.358  3944  4232 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=fa2694b3-f9a6-41c8-a551-39db21460d98, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ]
08-08 09:58:13.017  3944  3944 I OneSignal: Completed setting external user id: devtest-3884with results: {"push":{"success":true}}
08-08 09:58:16.756  3944 16789 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent a]
08-08 09:58:16.756  3944 16789 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 09:58:16.756  3944 16789 I TSLocationManager: β•‘ ⏰ OneShot event fired: TERMINATE_EVENT
08-08 09:58:16.756  3944 16789 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 09:58:16.757  3944 16789 D TSLocationManager: [c.t.l.event.TerminateEvent$a onChange]
08-08 09:58:16.757  3944 16789 D TSLocationManager:   ℹ️  TERMINATE_EVENT ignored (MainActivity is still active).
08-08 09:58:29.380  3944 16689 W OneSignal: Location permission exists but GoogleApiClient timed out. Maybe related to mismatch google-play aar versions.
08-08 09:58:44.005  3944  4194 I Mapbox  : [threading]: Worker 4 priority is now 4
08-08 09:59:07.742  3944 16919 D TrafficStats: tagSocket(219) with statsTag=0xffffffff, statsUid=-1
08-08 10:01:07.419  3944  3944 D TSLocationManager: [c.t.l.service.AbstractService a]
08-08 10:01:07.419  3944  3944 D TSLocationManager:   🎾  5:5 [LocationRequestService  startId: 1, eventCount: 1]
08-08 10:01:07.420  3944 16953 I TSLocationManager: [c.t.l.l.TSLocationManager a]
08-08 10:01:07.420  3944 16953 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 10:01:07.420  3944 16953 I TSLocationManager: β•‘ watchPosition LocationResult: 5 (117ms old)
08-08 10:01:07.420  3944 16953 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 10:01:07.420  3944 16953 I TSLocationManager: β•Ÿβ”€ πŸ“  Location[fused -25.790943,28.304846 hAcc=82.5 et=+21m0s24ms alt=1425.699951171875 vAcc=7.831059], time: 1723104067302
08-08 10:01:07.421  3944 16953 D TSLocationManager: [c.t.l.l.TSLocationManager a] Median accuracy: 2.45
08-08 10:01:07.425  3944 16953 D TSLocationManager: [c.t.l.service.AbstractService a]
08-08 10:01:07.425  3944 16953 D TSLocationManager:   βš™οΈοΈŽ   FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true]
08-08 10:01:07.425  3944 16954 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
08-08 10:01:07.425  3944 16954 I TSLocationManager:   βœ…  INSERT: 134bd5de-f6b6-462f-ad1e-323a05fee973
08-08 10:01:07.427  3944 16954 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO shrink]
08-08 10:01:07.427  3944 16954 D TSLocationManager:   ℹ️  SHRINK: 1
08-08 10:01:07.428  3944 16954 I TSLocationManager: [c.t.l.http.HttpService flush]
08-08 10:01:07.428  3944 16954 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 10:01:07.428  3944 16954 I TSLocationManager: β•‘ HTTP Service (count: 1)
08-08 10:01:07.428  3944 16954 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 10:01:07.447  3944  3944 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 10
08-08 10:01:07.449  3944 16954 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO first]
08-08 10:01:07.449  3944 16954 D TSLocationManager:   βœ…  Locked 1 records
08-08 10:01:07.450  3944 16954 I TSLocationManager: [c.t.l.http.HttpService a]
08-08 10:01:07.450  3944 16954 I TSLocationManager:   πŸ”΅  HTTP POST: 134bd5de-f6b6-462f-ad1e-323a05fee973
08-08 10:01:07.535  3944 16956 D TrafficStats: tagSocket(177) with statsTag=0xffffffff, statsUid=-1
08-08 09:59:07.742  3944 16919 D TrafficStats: tagSocket(219) with statsTag=0xffffffff, statsUid=-1
08-08 10:01:07.419  3944  3944 D TSLocationManager: [c.t.l.service.AbstractService a]
08-08 10:01:07.419  3944  3944 D TSLocationManager:   🎾  5:5 [LocationRequestService  startId: 1, eventCount: 1]
08-08 10:01:07.420  3944 16953 I TSLocationManager: [c.t.l.l.TSLocationManager a]
08-08 10:01:07.420  3944 16953 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 10:01:07.420  3944 16953 I TSLocationManager: β•‘ watchPosition LocationResult: 5 (117ms old)
08-08 10:01:07.420  3944 16953 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 10:01:07.420  3944 16953 I TSLocationManager: β•Ÿβ”€ πŸ“  Location[fused -25.790943,28.304846 hAcc=82.5 et=+21m0s24ms alt=1425.699951171875 vAcc=7.831059], time: 1723104067302
08-08 10:01:07.421  3944 16953 D TSLocationManager: [c.t.l.l.TSLocationManager a] Median accuracy: 2.45
08-08 10:01:07.425  3944 16953 D TSLocationManager: [c.t.l.service.AbstractService a]
08-08 10:01:07.425  3944 16953 D TSLocationManager:   βš™οΈοΈŽ   FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true]
08-08 10:01:07.425  3944 16954 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
08-08 10:01:07.425  3944 16954 I TSLocationManager:   βœ…  INSERT: 134bd5de-f6b6-462f-ad1e-323a05fee973
08-08 10:01:07.427  3944 16954 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO shrink]
08-08 10:01:07.427  3944 16954 D TSLocationManager:   ℹ️  SHRINK: 1
08-08 10:01:07.428  3944 16954 I TSLocationManager: [c.t.l.http.HttpService flush]
08-08 10:01:07.428  3944 16954 I TSLocationManager: ╔═════════════════════════════════════════════
08-08 10:01:07.428  3944 16954 I TSLocationManager: β•‘ HTTP Service (count: 1)
08-08 10:01:07.428  3944 16954 I TSLocationManager: ╠═════════════════════════════════════════════
08-08 10:01:07.447  3944  3944 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 10
08-08 10:01:07.449  3944 16954 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO first]
08-08 10:01:07.449  3944 16954 D TSLocationManager:   βœ…  Locked 1 records
08-08 10:01:07.450  3944 16954 I TSLocationManager: [c.t.l.http.HttpService a]
08-08 10:01:07.450  3944 16954 I TSLocationManager:   πŸ”΅  HTTP POST: 134bd5de-f6b6-462f-ad1e-323a05fee973
08-08 10:01:07.535  3944 16956 D TrafficStats: tagSocket(177) with statsTag=0xffffffff, statsUid=-1
08-08 10:01:08.802  3944 16956 I TSLocationManager: [c.t.l.http.HttpService$f onResponse]
08-08 10:01:08.802  3944 16956 I TSLocationManager:   πŸ”΅  Response: 200
08-08 10:01:08.804  3944 16956 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroy]
08-08 10:01:08.804  3944 16956 D TSLocationManager:   βœ…  DESTROY: 134bd5de-f6b6-462f-ad1e-323a05fee973
08-08 10:01:08.808  3944 16956 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 10
08-08 10:01:08.810  3944  4232 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=bb6cee2a-2dcf-449d-a07b-62d41aa63ca3, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ]
08-08 10:01:08.810  3944 16954 I TSLocationManager: [c.t.locationmanager.rpc.a run] ⚑️[RPC: setConfig: {"distanceFilter":150,"autoSyncThreshold":1,"disableElasticity":true,"maxRecordsToPersist":1,"stationaryRadius":50,"disableStopDetection":true}]
08-08 10:01:11.038  3944  3944 I ViewRootImpl@a0a0f3f[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 0
08-08 10:01:13.935  3944  3944 D InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=true, type=2
08-08 10:01:13.937  3944  3944 D InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=true, type=1
08-08 10:01:13.953  3944  3944 I ViewRootImpl@a0a0f3f[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 0
08-08 10:01:13.953  3944  3944 D ViewRootImpl@a0a0f3f[MainActivity]: mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb400006fcb77f000}
08-08 10:01:13.953  3944 16697 I ViewRootImpl@a0a0f3f[MainActivity]: mWNT: t=0xb400006fcb994c80 mBlastBufferQueue=0xb40000700a01cd00 fn= 60 caller= android.view.SyncRtSurfaceTransactionApplier.applyTransaction:96 android.view.SyncRtSurfaceTransactionApplier.lambda$scheduleApply$0:69 android.view.SyncRtSurfaceTransactionApplier.$r8$lambda$SgowXC58rj3PR958kHUfRgLZmvE:0
08-08 10:01:13.954  3944  3944 D InputMethodManagerUtils: startInputInner - Id : 0
08-08 10:01:13.954  3944  3944 I InputMethodManager: startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
08-08 10:01:13.956  3944 16669 I gralloc4: @set_metadata: update dataspace from GM (0x00000000 -> 0x08010000)
08-08 10:02:07.884  3944 17011 D TrafficStats: tagSocket(173) with statsTag=0xffffffff, statsUid=-1
08-08 10:04:17.523  3944  3970 I nder.production: Thread[2,tid=3970,WaitingInMainSignalCatcherLoop,Thread*=0xb40000708c400000,peer=0x13d00000,"Signal Catcher"]: reacting to signal 3
08-08 10:04:17.523  3944  3970 I nder.production:
08-08 10:04:17.918  3944  3970 I nder.production: Wrote stack traces to tombstoned
08-08 10:04:22.253  3944  3944 I ViewRootImpl@a0a0f3f[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 0
08-08 10:04:22.389  3944  4665 D TrafficStats: tagSocket(173) with statsTag=0x1, statsUid=-1

ANR Log

08-08 10:04:17.421  1384  1420 E ActivityManager: Short FGS ANR'ed: ServiceRecord{8f3c095 u0 com.aura.responder.production/com.transistorsoft.locationmanager.service.LocationRequestService}
08-08 10:04:17.426  1384 17032 D ActivityManager: created ANR temporary file:/data/anr/temp_anr_8696483196750313919.txt
08-08 10:04:19.307  1384 17033 D SystemDumpWriter_ANR: Successful to save dumpsys to log/dumpsys_ANR_WindowManager.txt
08-08 10:04:19.308  1384 17033 D SystemDumpWriter_ANR: save dumpsys, duration=1876
08-08 10:04:22.068  1384 17033 E ActivityManager: ANR in com.aura.responder.production
08-08 10:04:22.073  1384 17033 D ActivityManager: Completed ANR of com.aura.responder.production in 4649ms, latency 1ms
08-08 10:04:22.117  3220  3220 I DMASA[D]: [ANRDetectionService]Enqueue work to ANR
08-08 10:04:22.168  3220  3718 W DMASA[D]: [ANRDetectionService]ServiceInfo is empty

reinhardholl avatar Aug 08 '24 08:08 reinhardholl

let me know how to reproduce.

christocracy avatar Aug 08 '24 08:08 christocracy

let me know how to reproduce.

To be honest, all I am doing is opening the app and keeping it on our "home screen". Our app remains active in the foreground. After about 5-10 minutes the ANR pops up. Not really doing anything out of the ordinary. Ive removed heartbeats etc to see if it makes a difference, but did not notice any improvement.

reinhardholl avatar Aug 08 '24 09:08 reinhardholl

See wiki β€œDebugging”. Learn to fetch plug-in logs using β€œ.emailLog” method

christocracy avatar Aug 08 '24 09:08 christocracy

See wiki β€œDebugging”. Learn to fetch plug-in logs using β€œ.emailLog” method

Do they differ from the ADB logs?

reinhardholl avatar Aug 08 '24 09:08 reinhardholl

@reinhardholl here, I just logged into our paid support account (forgot to do it). Anyway, here are the email logs:

Config details

``` ╔═════════════════════════════════════════════ β•‘ TSLocationManager3.5.4 (433) ╠═════════════════════════════════════════════ β•Ÿβ”€ samsung SM-A055F @ 14 (react) { "activityRecognitionInterval": 10000, "allowIdenticalLocations": false, "authorization": {}, "autoSync": true, "autoSyncThreshold": 1, "backgroundPermissionRationale": { "title": "Allow The Aura responder App to access to this device's location in the background?", "message": "This app collects location data to enable tracking even when the app is closed or not in use. Please enable always on location permission", "positiveAction": "Change to always on ", "negativeAction": "Cancel" }, "batchSync": false, "configUrl": "", "crashDetector": { "enabled": false, "accelerometerThresholdHigh": 20, "accelerometerThresholdLow": 4.5, "gyroscopeThresholdHigh": 20, "gyroscopeThresholdLow": 4.5 }, "debug": false, "deferTime": 0, "desiredAccuracy": -1, "desiredOdometerAccuracy": 100, "disableAutoSyncOnCellular": false, "disableElasticity": true, "disableLocationAuthorizationAlert": false, "disableMotionActivityUpdates": true, "disableProviderChangeRecord": false, "disableStopDetection": true, "distanceFilter": 150, "elasticityMultiplier": 1, "enableHeadless": true, "enableTimestampMeta": false, "extras": {}, "fastestLocationUpdateInterval": -1, "foregroundService": true, "geofenceInitialTriggerEntry": true, "geofenceModeHighAccuracy": false, "geofenceProximityRadius": 1000, "geofenceTemplate": "", "headers": { "authorization": "" }, "headlessJobService": "com.transistorsoft.rnbackgroundgeolocation.HeadlessTask", "heartbeatInterval": 300, "httpRootProperty": "location", "httpTimeout": 60000, "isMoving": false, "locationAuthorizationRequest": "Always", "locationTemplate": "", "locationTimeout": 60, "locationUpdateInterval": 1000, "locationsOrderDirection": "ASC", "logLevel": 5, "logMaxDays": 3, "maxBatchSize": 1, "maxDaysToPersist": 1, "maxMonitoredGeofences": 97, "maxRecordsToPersist": 1, "method": "POST", "minimumActivityRecognitionConfidence": 75, "motionTriggerDelay": 0, "notification": { "layout": "", "title": "", "text": "", "color": "", "channelName": "TSLocationManager", "channelId": "com.aura.responder.production.TSLocationManager", "smallIcon": "", "largeIcon": "", "priority": -1, "sticky": false, "strings": {}, "actions": [] }, "params": { "deviceInfo": { "fused": true, "systemName": "Android", "network": true, "gps": true, "passive": true, "carrier": "Vodacom-SA", "baseOs": "samsung\/a05mxx\/a05m:14\/UP1A.231005.007\/A055FXXU2BWL6:user\/release-keys", "brand": "samsung" }, "responderId": 3884, "responderDeleted": false }, "persist": true, "persistMode": 2, "schedule": [], "scheduleUseAlarmManager": false, "speedJumpFilter": 300, "startOnBoot": true, "stationaryRadius": 50, "stopAfterElapsedMinutes": 0, "stopOnStationary": false, "stopOnTerminate": false, "stopTimeout": 5, "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking", "url": "https:\/\/dev-api.aura.services\/locations-api\/v1\/responder\/location\/3884", "useSignificantChangesOnly": false, "enabled": true, "schedulerEnabled": false, "trackingMode": 1, "odometer": 48781.46875, "isFirstBoot": false, "didLaunchInBackground": false, "didDeviceReboot": false } ╔═════════════════════════════════════════════ β•‘ DEVICE SENSORS ╠═════════════════════════════════════════════ β•Ÿβ”€ βœ… ACCELEROMETER: {Sensor name="MXC4005_Accelerometer", vendor="acc_mxc4005x", version=1, type=1, maxRange=78.453606, resolution=0.0012, power=0.001, minDelay=5000} β•Ÿβ”€ ⚠️ GYROSCOPE: none. Motion-detection system performance will be degraded β•Ÿβ”€ ⚠️ MAGNETOMETER: none. Motion-detection system performance will be degraded β•Ÿβ”€ βœ… SIGNIFICANT_MOTION: {Sensor name="SIGNIFICANT_MOTION", vendor="MTK", version=1, type=17, maxRange=1.0, resolution=1.0, power=0.001, minDelay=-1} β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ```
### Attached email log file

background-geolocation-2.log

aura-developers avatar Aug 08 '24 11:08 aura-developers

And those logs contain a reproduction of your ANR?

christocracy avatar Aug 08 '24 12:08 christocracy

And those logs contain a reproduction of your ANR?

The ANR logs only show up if I do adb logcat | grep ANR (as added in the original issue)

08-08 10:04:17.421  1384  1420 E ActivityManager: Short FGS ANR'ed: ServiceRecord{8f3c095 u0 com.aura.responder.production/com.transistorsoft.locationmanager.service.LocationRequestService}
08-08 10:04:17.426  1384 17032 D ActivityManager: created ANR temporary file:/data/anr/temp_anr_8696483196750313919.txt
08-08 10:04:19.307  1384 17033 D SystemDumpWriter_ANR: Successful to save dumpsys to log/dumpsys_ANR_WindowManager.txt
08-08 10:04:19.308  1384 17033 D SystemDumpWriter_ANR: save dumpsys, duration=1876
08-08 10:04:22.068  1384 17033 E ActivityManager: ANR in com.aura.responder.production
08-08 10:04:22.073  1384 17033 D ActivityManager: Completed ANR of com.aura.responder.production in 4649ms, latency 1ms
08-08 10:04:22.117  3220  3220 I DMASA[D]: [ANRDetectionService]Enqueue work to ANR
08-08 10:04:22.168  3220  3718 W DMASA[D]: [ANRDetectionService]ServiceInfo is empty

aura-developers avatar Aug 08 '24 12:08 aura-developers

I need to see the several minutes of logs leading up to the ANR

christocracy avatar Aug 08 '24 12:08 christocracy

I need to see the several minutes of logs leading up to the ANR

Do you need all device logs or a specific filter? (all would be a ton, probably easier to email)

aura-developers avatar Aug 08 '24 13:08 aura-developers

Filtered with TSLocationManager. Then zipped and file-attached here (do not post raw text)

christocracy avatar Aug 08 '24 20:08 christocracy

@christocracy @reinhardholl Guys, did you figure out what the cause was? We have a similar issue. If it was the library should we expect a fix anytime soon?

pavlo-tretiak avatar Sep 02 '24 16:09 pavlo-tretiak

If it was the library should we expect a fix anytime soon?

it’s not caused by this plug-in. It’s caused by your own code or some other plug-in spending too much time blocking the main thread.

this plug-in is VERY careful to not block the main thread.

my published demo app on the play store does not see these issues.

christocracy avatar Sep 02 '24 17:09 christocracy

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 03 '24 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 17 '24 02:10 github-actions[bot]