transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
655 stars 277 forks source link

Cordova / Android - plugin not running #1343

Closed ageissel closed 2 years ago

ageissel commented 2 years ago

Your Environment

package.xml - dependencies

        "cordova-custom-config": "5.1.1",
        "cordova-plugin-device": "2.0.3",
        "cordova-plugin-splashscreen": "6.0.0",
        "cordova-plugin-whitelist": "1.3.4",
        "cordova-plugin-statusbar": "2.4.3",
        "monaca-plugin-monaca-core": "3.3.1",
        "cordova-plugin-enable-multidex": "",
        "cordova-plugin-firebasex": "11.0.1-cli",
        "ionic-plugin-deeplinks": "",
        "cordova-plugin-inappbrowser": "5.0.0",
        "cordova-plugin-screen-orientation": "",
        "cordova-plugin-qr-barcode-scanner": "",
        "cordova-background-geolocation-lt": "",
        "cordova-plugin-androidx-adapter": ""

config.xml (Cordova) extract:

  <platform name="android">
    <preference name="android-targetSdkVersion" value="30"/>
    <config-file mode="merge" parent="/*" target="AndroidManifest.xml">
      <uses-permission android:name="android.permission.CAMERA"/>
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    </config-file>
    <config-file mode="merge" parent="/manifest/application" target="app/src/main/AndroidManifest.xml">
      <meta-data android:name="com.transistorsoft.locationmanager.license_key" android:value="...redacted..."/>
      <service android:foregroundServiceType="location" android:name="com.transistorsoft.locationmanager.service.TrackingService"/>
      <service android:foregroundServiceType="location" android:name="com.transistorsoft.locationmanager.service.LocationRequestService"/>
    </config-file>
    <preference name="AndroidXEnabled" value="true"/>
... icons & resource files removed ...
  </platform>

Expected Behavior

The implementation works a treat on iOS, where we use the plugin to capture the user's position while recording is active, including prompts for permissions, etc.

Actual Behavior

On Android, the App builds and installs (release build), but the plugin is not enabled / invoked by the above code.

On first install, the location permissions popup is not shown, although it is shown for the CAMERA permission when access to the camera is first requested.

Manually enabling access to LOCATION services in Settings activates the browser native navigator.geolocation API, but not for the Plugin (although I assume that they are very different processes).

adb log output does not appear to help :-(

Our build environment versions are stable. Moving to Cordova 11 breaks Firebase, amongst others. Also, we need to maximise our real-world device compatibility, for which our current configuration is a stable match.

Context

Have I missed something?

Also, is there a means to detect if the plugin is enabled and ready to be called? In case we wish to include a HTML5-based fallback (without background!).

Many thanks!

Debug logs

Logs ``` ./adb logcat "*:S" TSLocationManager:V chromium:V --------- beginning of crash --------- beginning of system --------- beginning of main 04-12 14:11:28.630 6889 6965 E chromium: [ERROR:simple_index_file_posix.cc(36)] opendir /data/user/0/com.surpassport.participate.ksp/cache/WebView/Default/HTTP Cache/Code Cache/js: No such file or directory (2) 04-12 14:11:28.631 6889 6965 E chromium: [ERROR:simple_index_file.cc(577)] Could not reconstruct index from disk 04-12 14:17:14.522 8932 9040 W chromium: [WARNING:spdy_session.cc(3541)] Received HEADERS for invalid stream 3 04-12 14:17:20.348 8932 9040 W chromium: [WARNING:spdy_session.cc(3541)] Received HEADERS for invalid stream 9 ```
christocracy commented 2 years ago

Show UNFILTERED logcat.

$ adb logcat
christocracy commented 2 years ago

Our build environment versions are stable. Moving to Cordova 11 breaks

I doubt you'll be able to support Android 12 without Cordova 11 / cordova-android@10.1.1

ageissel commented 2 years ago

Thanks Chris for the prompt response.

Logs attached (too long to post) android.log

ageissel commented 2 years ago

I doubt you'll be able to support Android 12 without Cordova 11 / cordova-android@10.1.1

Agreed .. but timing is against us at the moment, where a high proportion of our users are still on Android 9 :-)

christocracy commented 2 years ago

Your problem is not likely related to background-geolocation at all. When you see exceptions like this, you are likely having "multidex" issues and will likely want to be installing something like cordova-plugin-enable-multidex (if it's still supported).

You should really migrate to Capacitor. It has far better support for stuff like this. Cordova is dying.

ageissel commented 2 years ago

Thanks @christocracy.

cordova-plugin-enable-multidex is part of our setup, but will take a fresh look at the environment.

Migrating is on our roadmap, but again, not so much in the short(er) term, because of our tooling around remote build / headless build environment [local development uses Centos servers and platform-native builds are generated using Monaca.io remote build capability).

Many thanks for the prompt response and will revert if I can isolate the issue further.

christocracy commented 2 years ago

Whatever your issue is, there is no reference at all to background-geolocation namespace in your log (com.transistorsoft).

I find it odd that some of your plugin dependencies have no version declared.


"cordova-plugin-enable-multidex": "",

"ionic-plugin-deeplinks": "",

"cordova-plugin-screen-orientation": "",
        "cordova-plugin-qr-barcode-scanner": "",
        "cordova-background-geolocation-lt": "",
        "cordova-plugin-androidx-adapter": ""
ageissel commented 2 years ago

Hi @christocracy,

Still having issues here .. I am now testing on an Android11 / Xiaomi Redmi 10 device, and also added some additional trace markers.

The plugin is initialising, but seems to stop almost immediately.

The conlog trace for TSLocation is as follows:

2022-04-14 13:44:26.513 29664-29813/? D/TSLocationManager: $ addLocationListener()
2022-04-14 13:44:26.514 29664-29813/? D/TSLocationManager: $ addMotionChangeListener()
2022-04-14 13:44:31.317 29664-29813/? D/TSLocationManager: $ ready()
2022-04-14 13:44:31.318 29664-29813/? W/TSLocationManager: [c.t.c.b.CDVBackgroundGeolocation ready] 
      ⚠️  #ready already called.  Redirecting to #setConfig
2022-04-14 13:44:31.324 29664-29813/? D/TSLocationManager: $ start()
2022-04-14 13:44:31.324 29664-29813/? D/TSLocationManager: [c.t.locationmanager.util.c g] 
      ℹ️  LocationAuthorization: Permission granted
2022-04-14 13:44:31.336 29664-29890/? I/TSLocationManager: - Enable: true → true, trackingMode: 1
2022-04-14 13:44:31.336 29664-29890/? I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 
      🎾  Start motion-activity updates
2022-04-14 13:44:31.339 29664-29890/? D/TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 
      🎾  Start monitoring connectivity changes
2022-04-14 13:44:31.339 29664-29890/? D/TSLocationManager: [c.t.locationmanager.device.a c] 
      🎾  Start monitoring powersave changes
2022-04-14 13:44:31.340 29664-29890/? D/TSLocationManager: [c.t.locationmanager.util.c h] 
      ℹ️  LocationAuthorization: Permission granted
2022-04-14 13:44:31.340 29664-29890/? I/TSLocationManager: [c.t.l.service.HeartbeatService b] 
      🎾  Start heartbeat (60s)
2022-04-14 13:44:31.520 29664-29813/? D/TSLocationManager: $ destroyLocations()
2022-04-14 13:44:31.534 29664-29813/? D/TSLocationManager: $ setOdometer()
2022-04-14 13:44:31.538 29664-29890/? I/TSLocationManager: [c.t.l.l.TSLocationManager setOdometer] 
      ℹ️  setOdometer: 0.0, isMoving: false
2022-04-14 13:44:31.539 29664-29890/? D/TSLocationManager: [c.t.l.l.TSLocationManager clearLastOdometerLocation] 
      ℹ️  Clear last odometer location
2022-04-14 13:44:31.540 29664-29890/? D/TSLocationManager: [c.t.locationmanager.util.c h] 
      ℹ️  LocationAuthorization: Permission granted
2022-04-14 13:44:31.568 1325-2915/? I/ActivityTaskManager: START u0 {act=locationsettings flg=0x10000000 cmp=com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} from uid 10271
2022-04-14 13:44:31.577 1325-2915/? V/ActivityTaskManager: Starting new activity ActivityRecord{d72e152 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity t183} in new task Task{1fd1c23 #183 visible=true type=standard mode=fullscreen translucent=true A=10271:com.surpassport.participate.ksp U=0 StackId=183 sz=1}
2022-04-14 13:44:31.598 693-711/? I/mtkpower@impl: [notifyAppState] act com.surpassport.participate.ksp.MainActivity => com.transistorsoft.locationmanager.activity.TSLocationManagerActivity
2022-04-14 13:44:31.609 29664-29664/? D/TSLocationManager: [c.t.l.a.TSLocationManagerActivity execute] locationsettings
2022-04-14 13:44:31.609 29664-29664/? D/TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
2022-04-14 13:44:31.620 29664-29664/? D/ViewRootImpl[TSLocationManagerActivity]: hardware acceleration = true , fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated = false, sSystemRendererDisabled = false
2022-04-14 13:44:31.624 29664-29664/? V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@b526a5e, this = DecorView@1d2f6e3[TSLocationManagerActivity]
2022-04-14 13:44:31.624 1325-2915/? V/MiuiActivityTaskManagerServiceEx: dispatchActivityLifeState r = ActivityRecord{d72e152 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity t183}
2022-04-14 13:44:31.625 2794-2794/? D/RecentsImpl: mActivityStateObserver com.transistorsoft.locationmanager.activity.TSLocationManagerActivity
2022-04-14 13:44:31.625 2794-2794/? W/RecentsImpl: onResumed className=com.transistorsoft.locationmanager.activity.TSLocationManagerActivity   mIsInAnotherPro=false
2022-04-14 13:44:31.626 1325-2915/? I/WindowManager: Relayout Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity}: oldVis=4 newVis=0 focusMayChange = true
2022-04-14 13:44:31.629 1325-2915/? V/WindowManager: Orientation start waiting for draw, mDrawState=DRAW_PENDING in Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity}, surfaceController Surface(name=com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity)/@0x8dd0049
2022-04-14 13:44:31.631 1325-2915/? W/WindowManager: Changing focus fromnull to Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:473 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6177 com.android.server.wm.WindowManagerService.relayoutWindow:2710 com.android.server.wm.Session.relayout:213 
2022-04-14 13:44:31.633 1325-2915/? D/WindowManager: Input focus has changed to Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity}
2022-04-14 13:44:31.636 753-812/? I/BufferQueueProducer: [com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0](id:2f1000003b6,api:1,p:29664,c:753) connect(): api=1 producerControlledByApp=false
2022-04-14 13:44:31.636 1325-4506/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.638 29664-29664/? D/TSLocationManager: [c.t.l.a.TSLocationManagerActivity stop] eventCount: 0
2022-04-14 13:44:31.640 1325-1471/? I/ActivityTaskManager: Displayed com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity: +72ms
2022-04-14 13:44:31.640 1325-1463/? I/Timeline: Timeline: Activity_windows_visible id: ActivityRecord{d72e152 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity t183} time:73731644
2022-04-14 13:44:31.643 1325-2915/? W/WindowManager: Changing focus fromWindow{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} to Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:473 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6177 com.android.server.wm.DisplayContent.layoutAndAssignWindowLayersIfNeeded:3589 com.android.server.wm.TaskDisplayArea.positionStackAt:808 
2022-04-14 13:44:31.653 1325-2515/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.653 1325-2515/? I/InputDispatcher: Focus entered window: Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} in display 0
2022-04-14 13:44:31.653 1325-2515/? I/InputDispatcher: Window went away: com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0
2022-04-14 13:44:31.661 753-3708/? I/BufferQueueProducer: [com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0](id:2f1000003b6,api:1,p:29664,c:753) disconnect(): api=1
2022-04-14 13:44:31.662 753-3708/? I/BufferQueueProducer: [com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0](id:2f1000003b6,api:1,p:29664,c:753) connect(): api=1 producerControlledByApp=false
2022-04-14 13:44:31.671 1325-2515/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.671 1325-2515/? I/InputDispatcher: Focus left window: Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} in display 0
2022-04-14 13:44:31.671 1325-2515/? I/InputDispatcher: Window went away: Window{b7d5413 mode=0 rootTaskId=183 u0 com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity}
2022-04-14 13:44:31.673 693-711/? I/mtkpower@impl: [notifyAppState] act com.transistorsoft.locationmanager.activity.TSLocationManagerActivity => com.surpassport.participate.ksp.MainActivity
2022-04-14 13:44:31.686 1325-4506/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.687 29664-29664/? V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent = android.view.ViewRootImpl@b526a5e, this = DecorView@1d2f6e3[TSLocationManagerActivity]
2022-04-14 13:44:31.688 29664-29664/? D/TSLocationManager: [c.t.l.a.TSLocationManagerActivity onDestroy] 
2022-04-14 13:44:31.689 753-3708/? I/BufferQueueProducer: [com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0](id:2f1000003b6,api:1,p:29664,c:753) disconnect(): api=1
2022-04-14 13:44:31.689 29664-29664/? D/View: [Warning] assignParent to null: this = DecorView@1d2f6e3[TSLocationManagerActivity]
2022-04-14 13:44:31.703 1325-2915/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.719 1325-2915/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.736 1325-2915/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.753 1325-2915/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.769 1325-2915/? I/InputDispatcher: setInputWindows displayId=0 Window{8d30b7b mode=0 rootTaskId=1 u0 NavigationBar0} Window{705ba1a mode=0 rootTaskId=1 u0 StatusBar} com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0 Window{c57fe2a mode=0 rootTaskId=181 u0 com.surpassport.participate.ksp/com.surpassport.participate.ksp.MainActivity} Window{cffda72 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.MiuiKeyguardPictorialWallpaper} Window{7abeed1 mode=0 rootTaskId=1 u0 com.miui.miwallpaper.wallpaperservice.ImageWallpaper} 
2022-04-14 13:44:31.786 753-753/? I/BufferQueueConsumer: [com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0](id:2f1000003b6,api:0,p:-1,c:753) disconnect()
2022-04-14 13:44:31.787 1325-2915/? I/InputDispatcher: Window went away: com.surpassport.participate.ksp/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity#0
2022-04-14 13:44:31.925 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 1]
2022-04-14 13:44:31.928 29664-29890/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ getCurrentPosition LocationResult: 3
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220787,-6.651452 hAcc=12 et=+20h31m39s648ms alt=161.0 vel=0.49709004 bear=266.78778 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 38ms, time: 1649940271889
2022-04-14 13:44:31.930 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 2]
2022-04-14 13:44:31.932 29664-30260/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ getCurrentPosition LocationResult: 2
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220787,-6.651452 hAcc=12 et=+20h31m39s648ms alt=161.0 vel=0.49709004 bear=266.78778 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 42ms, time: 1649940271889
2022-04-14 13:44:31.949 29664-29890/? D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 11.9105
2022-04-14 13:44:31.953 29664-29890/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 3 isFinished? false
2022-04-14 13:44:31.953 29664-29890/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 1, sticky: true]
2022-04-14 13:44:31.954 29664-30260/? I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 
      🔵  Acquired current position
2022-04-14 13:44:31.954 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 12.217
2022-04-14 13:44:31.956 29664-30260/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 2 isFinished? true
2022-04-14 13:44:31.957 29664-30260/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:31.964 29664-29664/? I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 
      🎾  Start motion-activity updates
2022-04-14 13:44:31.966 29664-29664/? D/TSLocationManager: [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion] 
      🎾  Start monitoring stationary region (radius: 150.0m 53.2207867,-6.651452 hAcc=12.217)
2022-04-14 13:44:31.972 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:31.976 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:31.977 29664-30260/? E/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ‼️  DESTROY FAILURE: d3bcd86f-a188-4e8f-ad2d-0c7389c517e4
2022-04-14 13:44:31.987 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  TrackingService [eventCount: 1]
2022-04-14 13:44:31.988 29664-29664/? I/TSLocationManager: [c.t.l.service.TrackingService h] 
    ╔═════════════════════════════════════════════
    ║ TrackingService motionchange: false
    ╠═════════════════════════════════════════════
2022-04-14 13:44:31.988 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: false]
2022-04-14 13:44:32.209 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  LocationRequestService destroyed
2022-04-14 13:44:32.241 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  TrackingService destroyed
2022-04-14 13:44:36.868 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 1]
2022-04-14 13:44:36.872 29664-30260/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ getCurrentPosition LocationResult: 3
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220787,-6.651453 hAcc=12 et=+20h31m44s542ms alt=161.0 vel=0.026980385 bear=266.7925 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 87ms, time: 1649940276783
2022-04-14 13:44:36.894 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 12.217
2022-04-14 13:44:36.898 29664-30260/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 3 isFinished? false
2022-04-14 13:44:36.899 29664-30260/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
2022-04-14 13:44:42.316 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 1]
2022-04-14 13:44:42.324 29664-30260/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ getCurrentPosition LocationResult: 3
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220791,-6.651437 hAcc=17 et=+20h31m49s982ms alt=161.0 vel=0.19652335 bear=63.69109 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 99ms, time: 1649940282223
2022-04-14 13:44:42.334 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.337 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  LocationRequestService destroyed
2022-04-14 13:44:42.364 29664-30260/? I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 
      🔵  Acquired current position
2022-04-14 13:44:42.366 29664-30260/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 3 isFinished? true
2022-04-14 13:44:42.366 29664-30260/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.375 29664-29813/? D/TSLocationManager: $ changePace()
2022-04-14 13:44:42.377 29664-30260/? D/TSLocationManager: [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [isMoving]
2022-04-14 13:44:42.379 29664-30260/? I/TSLocationManager: [c.t.l.service.HeartbeatService c] 
      🔴  Stop heartbeat
2022-04-14 13:44:42.379 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.380 29664-29890/? E/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ‼️  DESTROY FAILURE: 1866ec32-b519-42bf-918e-8f6892d4dd30
2022-04-14 13:44:42.381 29664-30260/? D/TSLocationManager: [c.t.l.g.TSGeofenceManager stopMonitoringStationaryRegion] 
      🔴  Stop monitoring stationary region
2022-04-14 13:44:42.384 29664-30260/? D/TSLocationManager: [c.t.locationmanager.util.c h] 
      ℹ️  LocationAuthorization: Permission granted
2022-04-14 13:44:42.385 29664-30260/? I/TSLocationManager: [c.t.l.service.TrackingService a] 
      🔵  setPace: false → true
2022-04-14 13:44:42.397 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  TrackingService [eventCount: 1]
2022-04-14 13:44:42.398 29664-29664/? I/TSLocationManager: [c.t.l.service.TrackingService h] 
    ╔═════════════════════════════════════════════
    ║ TrackingService motionchange: true
    ╠═════════════════════════════════════════════
2022-04-14 13:44:42.399 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
2022-04-14 13:44:42.493 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 1]
2022-04-14 13:44:42.494 29664-30260/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ motionchange LocationResult: 4
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220791,-6.651437 hAcc=17 et=+20h31m50s206ms alt=161.0 vel=0.19678645 bear=63.80565 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 47ms, time: 1649940282447
2022-04-14 13:44:42.496 29664-30260/? I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 
      🔵  Acquired motionchange position, isMoving: true
2022-04-14 13:44:42.496 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 12.217
2022-04-14 13:44:42.501 29664-30260/? I/TSLocationManager: [c.t.l.l.TSLocationManager requestLocationUpdates] 
      🎾  Location-services: ON
2022-04-14 13:44:42.501 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.502 29664-30260/? I/TSLocationManager: [c.t.l.l.TSLocationManager requestLocationUpdates] 
      🎾  Location-services: ON
2022-04-14 13:44:42.503 29664-30260/? D/TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
2022-04-14 13:44:42.505 29664-30260/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 4 isFinished? true
2022-04-14 13:44:42.506 29664-30260/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.511 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  LocationRequestService destroyed
2022-04-14 13:44:42.512 29664-29664/? I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 
      🎾  Start motion-activity updates
2022-04-14 13:44:42.514 29664-29664/? I/TSLocationManager: [c.t.l.l.TSLocationManager removeLocationUpdates] 
      🔴  Location-services: OFF
2022-04-14 13:44:42.515 29664-29890/? I/TSLocationManager: [c.t.l.data.sqlite.b persist] 
      ✅  INSERT: 59504a30-aac8-4682-8e75-69cb8982d3d2
2022-04-14 13:44:42.516 29664-29664/? I/TSLocationManager: [c.t.l.l.TSLocationManager requestLocationUpdates] 
      🎾  Location-services: ON
2022-04-14 13:44:42.516 29664-29664/? D/TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
2022-04-14 13:44:42.522 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.525 29664-29890/? D/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ✅  DESTROY: 59504a30-aac8-4682-8e75-69cb8982d3d2
2022-04-14 13:44:42.529 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.531 29664-30260/? E/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ‼️  DESTROY FAILURE: 59504a30-aac8-4682-8e75-69cb8982d3d2
2022-04-14 13:44:42.539 29664-29813/? D/TSLocationManager: $ getCurrentPosition()
2022-04-14 13:44:42.545 29664-30260/? D/TSLocationManager: [c.t.locationmanager.util.c h] 
      ℹ️  LocationAuthorization: Permission granted
2022-04-14 13:44:42.553 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  TrackingService [eventCount: 1]
2022-04-14 13:44:42.555 29664-29664/? D/TSLocationManager: [c.t.l.service.TrackingService b] 
    ╔═════════════════════════════════════════════
    ║ TrackingService: LocationResult
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220791,-6.651437 hAcc=17 et=+20h31m50s206ms alt=161.0 vel=0.19678645 bear=63.80565 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 107ms, time: 1649940282447
2022-04-14 13:44:42.555 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
2022-04-14 13:44:42.556 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager onLocationResult] 
    ╔═════════════════════════════════════════════
    ║ Process LocationResult
    ╠═════════════════════════════════════════════
2022-04-14 13:44:42.557 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager onLocationResult] 
      ℹ️  IGNORED: same as last location
2022-04-14 13:44:42.594 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  TrackingService [eventCount: 1]
2022-04-14 13:44:42.595 29664-29664/? D/TSLocationManager: [c.t.l.service.TrackingService b] 
    ╔═════════════════════════════════════════════
    ║ TrackingService: LocationResult
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220791,-6.651437 hAcc=17 et=+20h31m50s206ms alt=161.0 vel=0.19678645 bear=63.80565 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 148ms, time: 1649940282447
2022-04-14 13:44:42.597 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager onLocationResult] 
    ╔═════════════════════════════════════════════
    ║ Process LocationResult
    ╠═════════════════════════════════════════════
2022-04-14 13:44:42.597 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager onLocationResult] 
      ℹ️  IGNORED: same as last location
2022-04-14 13:44:42.598 29664-29664/? I/TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 
      ⏰ Scheduled OneShot: STOP_TIMEOUT in 60000ms (jobID: 2059034116)
2022-04-14 13:44:42.610 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
2022-04-14 13:44:42.730 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 1]
2022-04-14 13:44:42.731 29664-30260/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ getCurrentPosition LocationResult: 5
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220792,-6.651436 hAcc=17 et=+20h31m50s436ms alt=161.0 vel=0.18634231 bear=63.879574 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 54ms, time: 1649940282677
2022-04-14 13:44:42.734 29664-30260/? I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 
      🔵  Acquired current position
2022-04-14 13:44:42.735 29664-30260/? D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 12.217
2022-04-14 13:44:42.741 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.743 29664-30260/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 5 isFinished? true
2022-04-14 13:44:42.745 29664-30260/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.746 29664-29890/? I/TSLocationManager: [c.t.l.data.sqlite.b persist] 
      ✅  INSERT: 5ed2f496-81bf-4167-b14b-ae3c730e9896
2022-04-14 13:44:42.748 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  LocationRequestService destroyed
2022-04-14 13:44:42.751 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.753 29664-29890/? D/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ✅  DESTROY: 5ed2f496-81bf-4167-b14b-ae3c730e9896
2022-04-14 13:44:42.756 29664-29813/? D/TSLocationManager: $ changePace()
2022-04-14 13:44:42.762 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.764 29664-30260/? E/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ‼️  DESTROY FAILURE: 5ed2f496-81bf-4167-b14b-ae3c730e9896
2022-04-14 13:44:42.768 29664-29890/? D/TSLocationManager: [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [isMoving]
2022-04-14 13:44:42.772 29664-29890/? I/TSLocationManager: [c.t.l.l.TSLocationManager removeLocationUpdates] 
      🔴  Location-services: OFF
2022-04-14 13:44:42.778 29664-29890/? I/TSLocationManager: [c.t.l.service.HeartbeatService b] 
      🎾  Start heartbeat (60s)
2022-04-14 13:44:42.781 29664-29890/? D/TSLocationManager: [c.t.locationmanager.util.c h] 
      ℹ️  LocationAuthorization: Permission granted
2022-04-14 13:44:42.782 29664-29890/? I/TSLocationManager: [c.t.l.service.TrackingService a] 
      🔵  setPace: true → false
2022-04-14 13:44:42.873 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  LocationRequestService [eventCount: 1]
2022-04-14 13:44:42.875 29664-29890/? I/TSLocationManager: [c.t.l.s.LocationRequestService b] 
    ╔═════════════════════════════════════════════
    ║ motionchange LocationResult: 6
    ╠═════════════════════════════════════════════
    ╟─ 📍  Location[fused 53.220792,-6.651436 hAcc=17 et=+20h31m50s557ms alt=161.0 vel=0.17250085 bear=63.947754 vAcc=1 sAcc=??? bAcc=??? {Bundle[EMPTY_PARCEL]}], age: 76ms, time: 1649940282798
2022-04-14 13:44:42.877 29664-29890/? I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 
      🔵  Acquired motionchange position, isMoving: false
2022-04-14 13:44:42.879 29664-29890/? D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 12.217
2022-04-14 13:44:42.881 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.883 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  LocationRequestService destroyed
2022-04-14 13:44:42.886 29664-29890/? D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 6 isFinished? true
2022-04-14 13:44:42.887 29664-29890/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.890 29664-29664/? I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 
      🎾  Start motion-activity updates
2022-04-14 13:44:42.892 29664-29664/? D/TSLocationManager: [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion] 
      🎾  Start monitoring stationary region (radius: 150.0m 53.2207915,-6.6514363 hAcc=16.916)
2022-04-14 13:44:42.893 29664-30260/? I/TSLocationManager: [c.t.l.data.sqlite.b persist] 
      ✅  INSERT: 7345c130-2a77-44f6-a741-4a717a5b1cb5
2022-04-14 13:44:42.895 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.898 29664-29813/? D/TSLocationManager: $ destroyLocation()
2022-04-14 13:44:42.899 29664-29890/? D/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ✅  DESTROY: 7345c130-2a77-44f6-a741-4a717a5b1cb5
2022-04-14 13:44:42.901 29664-30260/? E/TSLocationManager: [c.t.l.data.sqlite.b a] 
      ‼️  DESTROY FAILURE: 7345c130-2a77-44f6-a741-4a717a5b1cb5
2022-04-14 13:44:42.902 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  TrackingService [eventCount: 1]
2022-04-14 13:44:42.903 29664-29664/? I/TSLocationManager: [c.t.l.service.TrackingService h] 
    ╔═════════════════════════════════════════════
    ║ TrackingService motionchange: false
    ╠═════════════════════════════════════════════
2022-04-14 13:44:42.906 29664-29664/? I/TSLocationManager: [c.t.l.s.TSScheduleManager cancelOneShot] 
      ⏰ Cancel OneShot: STOP_TIMEOUT
2022-04-14 13:44:42.906 29664-29813/? D/TSLocationManager: $ removeListeners()
2022-04-14 13:44:42.907 29664-29813/? D/TSLocationManager: [c.t.l.a.BackgroundGeolocation a] 
      🔴  Cleared callbacks
2022-04-14 13:44:42.912 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: false]
2022-04-14 13:44:42.996 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService a] 
      🎾  ActivityRecognitionService [eventCount: 1]
2022-04-14 13:44:42.999 29664-30260/? D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 
      🚘 ️DetectedActivity [type=STILL, confidence=100]
2022-04-14 13:44:43.002 29664-30260/? D/TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish ActivityRecognitionService [eventCount: 0, sticky: false]
2022-04-14 13:44:43.166 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  TrackingService destroyed
2022-04-14 13:44:44.036 29664-29664/? D/TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
      🔴  ActivityRecognitionService destroyed

Is there a potential issue in initialising SQLite?

All help much appreciated. A

christocracy commented 2 years ago

Show me all the code where you're using BackgroundGeolocation.

No, there is not likely a problem with the plugin SQLite db, which has been working properly for years.

ageissel commented 2 years ago

Hi Chris.

Thanks for the fast response. I'm clutching at straws :-)

So, the init code is as provided in the issue description, only wrapped into a Promise.

The onUpdate handler extracts location data and builds a GeoJSON structure, which is then rendered using leaflet.js Our application is React.js built for Cordova, and the plugin bizarrely works a treat on iOS. Our apps too have been stable for years :)

Does that help?

christocracy commented 2 years ago

If you're not using the plug-in's built-in http service and you're just destroying records all the time, just configure the plugin to not even persist location. See api docs Config.persistMode.

Also, .ready() is designed to ONLY be called once when your app boots. Never more than once.

Calling .ready() does not imply "start tracking".

Only calling .start() makes the plugin start tracking.

It is not required to call start within the resolution of .ready().

ageissel commented 2 years ago

Ok - that's an angle to explore.

Persistence is important (I believe), as we could be tracking the users location over the course of a day, and we automatically fetch all missed locations when our tracking screen resumes - either because the user navigated away, or because the App was unloaded -- this is the attraction of your plugin.

I'll do some experimenting and will let you know.

Thank you.

christocracy commented 2 years ago
onAppBoot() {
  // Call .ready() each time your app boots.  Calling .ready() does not imply "start tracking"
  BackgroundGeolocation.ready(yourConfig);

} 

async myStartTrackingAction() {
   // Destroy your location BEFORE calling .start()
   await BackgroundGeolocation.destroyLocations();
   // Reset Odometer BEFORE calling .start()
   await BackgroundGeolocation.resetOdometer();
   await BackgroundGeolocation.start();
   await BackgroundGeolocation.changePace(true);
    // There is no need to call .getCurrentPosition after calling .start() since location will be already getting
   // emitted to onLocation event.
}

async myStopTrackingAction() {
  await BackgroundGeolocation.stop();
}
ageissel commented 2 years ago

Thanks. A

ageissel commented 2 years ago

HI Chris.

Brief update - I refractored our integration of the plugin so that .ready() is called as our App boots, and then started / stopped as triggered by the user.

That now works much better, and wanted to say thank you for your help.

One parting question .. on Android, the permission to access location is suppressed by Android until the plugin is first started, which has the unintended effect of disabling the HTML5 navigator.geolocation() API, as is used elsewhere in the App. The permission is requested in config.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Is there a setting or similar that I might have missed in the documentation that can fix this?

Again, many thanks. A

christocracy commented 2 years ago

The plugin has its own .getCurrentPosition() method. You don't need to use navigator.getCurrentPosition().

If you want to manually request permission, use a third-party lib specializing in permissions or use the plug-in's own .requestPermission() method. See the api docs.

ageissel commented 2 years ago

Thanks for all your help, Chris.