Auto Restarting after called stop() and killed the app
See original GitHub issueYour Environment
- Plugin version: 3.0.0-alpha.50
- Platform: Android
- OS version: 5.1.1
- Device manufacturer and model: samsung J3
- Running in Simulator: no
- Cordova version (
cordova -v
): 8.1.2 - Cordova platform version (
cordova platform ls
): android 7.1.4 - Plugin configuration options: { startOnBoot : true, saveBatteryOnBackground : true, stopOnStillActivity : false, stopOnTerminate : false, stationaryRadius: 10, distanceFilter: 100, debug: true, notificationsEnabled : false, url: scope.url.tasks + ‘/geofence/test.json?env=_app’, syncUrl : scope.url.tasks + ‘/geofence/test.json?env=_app’, syncThreshold : 1, postTemplate: { … }, httpHeaders: { … } }
- Link to your project: /
Context
the geolocation in the background starts again after calling the method stop () and killing the application
Expected Behavior
the geolocation in the background should not start again alone
Actual Behavior
Possible Fix
Steps to Reproduce
- start the application
- launch geolocation
- stop geolocation
- killed the application
Context
Debug logs
02-12 00:19:00.262 29687-29687/? E/Zygote: MountEmulatedStorage() 02-12 00:19:00.262 29687-29687/? E/Zygote: v2 02-12 00:19:00.262 29687-29687/? I/libpersona: KNOX_SDCARD checking this for 10251 02-12 00:19:00.262 29687-29687/? I/libpersona: KNOX_SDCARD not a persona 02-12 00:19:00.262 29687-29687/? I/SELinux: Function: selinux_compare_spd_ram , priority [2] , priority version is VE=SEPF_SM-J320FN_5.1.1_0073 02-12 00:19:00.272 29687-29687/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL 02-12 00:19:00.272 29687-29687/? I/art: Late-enabling -Xcheck:jni 02-12 00:19:00.272 29687-29687/? E/art: setrlimit(RLIMIT_CORE) failed for pid 29687: Operation not permitted 02-12 00:19:00.322 29687-29687/fr.pimis.app.users W/ResourcesManager: getTopLevelResources: /data/app/fr.pimis.app.users-1/base.apk / 1.0 running in fr.pimis.app.users rsrc of package fr.pimis.app.users 02-12 00:19:00.322 29687-29687/fr.pimis.app.users I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=} 02-12 00:19:00.332 29687-29687/fr.pimis.app.users D/ResourcesManager: For user 0 new overlays fetched Null 02-12 00:19:00.332 29687-29687/fr.pimis.app.users I/InjectionManager: Inside getClassLibPath caller 02-12 00:19:00.422 29687-29687/fr.pimis.app.users W/ResourcesManager: getTopLevelResources: /data/app/fr.pimis.app.users-1/base.apk / 1.0 running in fr.pimis.app.users rsrc of package fr.pimis.app.users 02-12 00:19:00.442 29687-29687/fr.pimis.app.users I/CrashlyticsCore: Initializing Crashlytics 2.6.1.23 02-12 00:19:00.482 29687-29712/fr.pimis.app.users W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in fr.pimis.app.users rsrc of package com.google.android.gms 02-12 00:19:00.492 29687-29704/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:00.492 29687-29704/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isShipBuild true 02-12 00:19:00.492 29687-29704/fr.pimis.app.users I/System.out: (HTTPLog)-Thread-3884-731971529: SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false 02-12 00:19:00.492 29687-29704/fr.pimis.app.users I/System.out: (HTTPLog)-Thread-3884-731971529: SMARTBONDING_FEATURE_ENABLED is false 02-12 00:19:00.502 29687-29704/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:00.502 29687-29704/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:00.502 29687-29687/fr.pimis.app.users I/CrashlyticsInitProvider: CrashlyticsInitProvider initialization successful 02-12 00:19:00.512 29687-29712/fr.pimis.app.users D/ResourcesManager: For user 0 new overlays fetched Null 02-12 00:19:00.512 29687-29712/fr.pimis.app.users W/ResourcesManager: Asset path ‘/system/framework/com.android.media.remotedisplay.jar’ does not exist or contains no resources. 02-12 00:19:00.512 29687-29712/fr.pimis.app.users W/ResourcesManager: Asset path ‘/system/framework/com.android.location.provider.jar’ does not exist or contains no resources. 02-12 00:19:00.552 29687-29704/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:00.572 29687-29723/fr.pimis.app.users W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 02-12 00:19:00.582 29687-29687/fr.pimis.app.users D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization. 02-12 00:19:00.582 29687-29687/fr.pimis.app.users I/FirebaseInitProvider: FirebaseApp initialization successful 02-12 00:19:00.592 29687-29728/fr.pimis.app.users W/zze: Application name is not set. Call Builder#setApplicationName. 02-12 00:19:00.622 29687-29727/fr.pimis.app.users W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 02-12 00:19:00.622 29687-29727/fr.pimis.app.users I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions. 02-12 00:19:00.622 29687-29727/fr.pimis.app.users I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation 02-12 00:19:00.643 29687-29687/fr.pimis.app.users W/ResourcesManager: getTopLevelResources: /data/app/fr.pimis.app.users-1/base.apk / 1.0 running in fr.pimis.app.users rsrc of package fr.pimis.app.users 02-12 00:19:00.653 29687-29734/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:00.653 29687-29734/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:00.663 29687-29687/fr.pimis.app.users D/InjectionManager: InjectionManager 02-12 00:19:00.663 29687-29733/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:00.663 29687-29687/fr.pimis.app.users D/InjectionManager: fillFeatureStoreMap fr.pimis.app.users 02-12 00:19:00.663 29687-29733/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:00.663 29687-29687/fr.pimis.app.users I/InjectionManager: Constructor fr.pimis.app.users, Feature store :{} 02-12 00:19:00.663 29687-29687/fr.pimis.app.users I/InjectionManager: featureStore :{} 02-12 00:19:00.703 29687-29734/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:00.713 29687-29687/fr.pimis.app.users W/art: Failed to open zip archive ‘/system/framework/timakeystore.jar’: I/O Error 02-12 00:19:00.713 29687-29743/fr.pimis.app.users W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in fr.pimis.app.users rsrc of package com.google.android.gms 02-12 00:19:00.713 29687-29733/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:00.713 29687-29743/fr.pimis.app.users D/ResourcesManager: For user 0 new overlays fetched Null 02-12 00:19:00.713 29687-29743/fr.pimis.app.users W/ResourcesManager: Asset path ‘/system/framework/com.android.media.remotedisplay.jar’ does not exist or contains no resources. 02-12 00:19:00.723 29687-29743/fr.pimis.app.users W/ResourcesManager: Asset path ‘/system/framework/com.android.location.provider.jar’ does not exist or contains no resources. 02-12 00:19:00.763 29687-29687/fr.pimis.app.users I/com.marianhello.bgloc.service.LocationServiceImpl: Creating LocationServiceImpl 02-12 00:19:00.773 29687-29687/fr.pimis.app.users I/com.marianhello.bgloc.PostLocationTask: Creating PostLocationTask 02-12 00:19:00.773 29687-29744/fr.pimis.app.users I/com.marianhello.bgloc.service.LocationServiceImpl: Network condition changed has connectivity: true 02-12 00:19:00.783 29687-29687/fr.pimis.app.users W/com.marianhello.bgloc.service.LocationServiceImpl: Attempt to start unconfigured service. Will use stored or default. 02-12 00:19:00.793 29687-29687/fr.pimis.app.users D/com.marianhello.bgloc.service.LocationServiceImpl: Will start service with: Config[distanceFilter=100 stationaryRadius=10.0 desiredAccuracy=100 interval=600000 fastestInterval=120000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=true startForeground=true notificationsEnabled=false locationProvider=0 nTitle=Background tracking nText=ENABLED nIconLarge= nIconSmall= nIconColor= url=http://pimis.tld/geofence/test.json?env=_app syncUrl=http://pimis.tld/geofence/test.json?env=_app syncThreshold=1 httpHeaders={Content-Type=application/json, X-AccessToken=971fe959f15a292a44c85d8bf6a0e12f} maxLocations=10000 postTemplate={“latitude”:“@latitude”,“pushToken”:“cqwylsbmis0:APA91bHsKYZ8_DmaEhenGJP6mDVQ6u3FFoszAgutfmzqOWylhdQhZ3C9xVNHGG8Ld-ca1-AN7Gxv6E1yLNzX2hJaK6X-Md0GvqfNae94g_MDJPhK_sIjbvt8TJlD3pNuxs0Xlo1WupfT”,“longitude”:“@longitude”,“userUUID”:“11E6C025D8D8B6E988A5FA163E724E8F”}] 02-12 00:19:00.803 29687-29687/fr.pimis.app.users I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Creating DistanceFilterLocationProvider 02-12 00:19:00.833 29687-29687/fr.pimis.app.users I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Start recording 02-12 00:19:00.833 29687-29687/fr.pimis.app.users I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Setting pace: false 02-12 00:19:00.893 29687-29687/fr.pimis.app.users I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Setting pace: true 02-12 00:19:01.013 29687-29736/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:01.013 29687-29736/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:01.013 29687-29736/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:01.063 29687-29712/fr.pimis.app.users W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in fr.pimis.app.users rsrc of package com.google.android.gms 02-12 00:19:01.073 29687-29712/fr.pimis.app.users D/ResourcesManager: For user 0 new overlays fetched Null 02-12 00:19:01.073 29687-29712/fr.pimis.app.users W/ResourcesManager: Asset path ‘/system/framework/com.android.media.remotedisplay.jar’ does not exist or contains no resources. 02-12 00:19:01.083 29687-29712/fr.pimis.app.users W/ResourcesManager: Asset path ‘/system/framework/com.android.location.provider.jar’ does not exist or contains no resources. 02-12 00:19:01.223 29687-29715/fr.pimis.app.users I/FA: App measurement is starting up, version: 14711 02-12 00:19:01.223 29687-29715/fr.pimis.app.users I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE 02-12 00:19:01.223 29687-29715/fr.pimis.app.users I/FA: To enable faster debug mode event logging run: adb shell setprop debug.firebase.analytics.app fr.pimis.app.users 02-12 00:19:01.613 29687-29734/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:01.633 29687-29687/fr.pimis.app.users D/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Location change: Location[network 42,531157,8,788716 acc=37 et=+1h28m8s281ms {Bundle[mParcelledData.dataSize=328]}] isMoving=true 02-12 00:19:01.653 29687-29687/fr.pimis.app.users D/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Location change: Location[network 42,531157,8,788716 acc=37 et=+1h28m8s281ms {Bundle[mParcelledData.dataSize=328]}] isMoving=true 02-12 00:19:01.684 29687-29750/fr.pimis.app.users D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false 02-12 00:19:01.724 29687-29750/fr.pimis.app.users I/OpenGLRenderer: Initialized EGL, version 1.4 02-12 00:19:01.724 29687-29750/fr.pimis.app.users D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 4096 02-12 00:19:01.724 29687-29750/fr.pimis.app.users D/OpenGLRenderer: Enabling debug mode 0 02-12 00:19:01.764 29687-29736/fr.pimis.app.users E/GraphResponse: {HttpStatus: 400, errorCode: 100, subErrorCode: 33, errorType: GraphMethodException, errorMessage: Unsupported get request. Object with ID ‘225015414575726’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api} 02-12 00:19:01.804 29687-29704/fr.pimis.app.users E/Fabric: Failed to retrieve settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/fr.pimis.app.users/settings 02-12 00:19:01.804 29687-29704/fr.pimis.app.users E/Answers: Failed to retrieve settings 02-12 00:19:01.814 29687-29706/fr.pimis.app.users W/CrashlyticsCore: Received null settings, skipping report submission! 02-12 00:19:05.167 29687-29687/fr.pimis.app.users D/InputMethodManager: windowDismissed mLockisused = false 02-12 00:19:08.670 29687-29687/fr.pimis.app.users D/InputMethodManager: windowDismissed mLockisused = false 02-12 00:19:16.018 29687-29743/fr.pimis.app.users W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/fr.pimis.app.users/files/AppEventsLogger.persistedevents 02-12 00:19:16.028 29687-29743/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:21.713 29687-29687/fr.pimis.app.users D/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Location change: Location[network 42,531157,8,788716 acc=32 et=+1h28m28s402ms {Bundle[mParcelledData.dataSize=328]}] isMoving=true 02-12 00:19:21.733 29687-29687/fr.pimis.app.users I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Setting pace: true 02-12 00:19:21.773 29687-29687/fr.pimis.app.users D/com.marianhello.bgloc.service.LocationServiceImpl: New location BGLocation[network 42,531157,8,788716 id=null acc=32 t=1549927161629 et=+1h28m28s402ms {Bundle[mParcelledData.dataSize=328]} locprov=0] 02-12 00:19:21.803 29687-29745/fr.pimis.app.users D/com.marianhello.bgloc.PostLocationTask: Executing PostLocationTask#postLocation 02-12 00:19:21.803 29687-29745/fr.pimis.app.users D/com.marianhello.bgloc.PostLocationTask: Posting json to url: http://pimis.tld/geofence/test.json?env=_app headers: {Content-Type=application/json, X-AccessToken=971fe959f15a292a44c85d8bf6a0e12f} 02-12 00:19:21.803 29687-29745/fr.pimis.app.users I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 02-12 00:19:21.813 29687-29745/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:21.823 29687-29745/fr.pimis.app.users I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false 02-12 00:19:25.236 29687-29687/fr.pimis.app.users D/InputMethodManager: windowDismissed mLockisused = false
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
Please try version 3.0.1. It shouldn’t start services on app visibility change, like app moving from foreground to background.
There is still once case, when service will be started automatically -> when you call
BackgroundGeolocation.headlessTask
. Just make sure you call it only when you already calledBackgroundGeolocation.start
.Thanks, now it was fixed for me!