Closed Gurjit-ONEBCG closed 5 years ago
Logs.
Logs.
Sorry I didn't implemented getLog method yet. I will come back with another try and log.
This was the route I traveled, as I see initially location logged perfectly but later no location logged. The end location captured is with getcurrentlocation method of gelocation plugin.
Same time I also used iPhone 6, and the location were logged correct in iOS
emailLog is convenient.
I tried another route and again service stopped after some interval of time. This time I used Nokia 6
Steps I followed. 1) Started the service. 2) Turned off the internet 3) Traveled <1 miles 4) stayed for 30 mins at least 5) Traveled another 4 miles 6) Turned on the internet 7) Called stop method
Logs length is too big to put them here. Please find them here https://docs.google.com/document/d/1R7rvgu9My8gBtXOs3YVM0h3W3hfgL7wUVkRO8qnS854/edit?usp=sharing
Another case locations not logged until I put the app in background. Please find logs here https://docs.google.com/document/d/1gNGuUV4AK5h0bJE8Ph-RPXrPoKIhph2lgAndTzDQmHA/edit
enableHeadless: true
. Have you implemented the BackgroundGeolocationHeadlessTask.java
?
You need to tell me timestamps in the logs that you're interested in.
I see you've configured
enableHeadless: true
. Have you implemented theBackgroundGeolocationHeadlessTask.java
?BackgroundGeolocationHeadlessTask.java
No I haven't implemented BackgroundGeolocationHeadlessTask.java,
I supposed to this will help to trigger event BackgroundGeolocation.onHeartbeat
even when the app is terminated.
Because its definition states
Set to true to enable "Headless" mode when the user terminates the application. In this mode, you
can respond to all the plugin's events in the native Android environment
Another case locations not logged until I put the app in background. Please find logs here https://docs.google.com/document/d/1gNGuUV4AK5h0bJE8Ph-RPXrPoKIhph2lgAndTzDQmHA/edit
These all logs are of single start and stop
If you haven't configured the headless-task, DO NOT enableHeadless: true
.
I tried another route and again service stopped after some interval of time. This time I used Nokia 6
Steps I followed.
- Started the service.
- Turned off the internet
- Traveled <1 miles
- stayed for 30 mins at least
- Traveled another 4 miles
- Turned on the internet
- Called stop method
Logs length is too big to put them here. Please find them here https://docs.google.com/document/d/1R7rvgu9My8gBtXOs3YVM0h3W3hfgL7wUVkRO8qnS854/edit?usp=sharing
Thanks for reply Chris!
I have removed the unwanted timestamp log from top. Please see the url again https://docs.google.com/document/d/1R7rvgu9My8gBtXOs3YVM0h3W3hfgL7wUVkRO8qnS854/edit
If you haven't configured the headless-task, DO NOT
enableHeadless: true
.
Okey, I will remove this property in my case, Was this the reason service not logged locations?
Was this the reason service not logged locations?
I have no idea. Try it and see.
Was this the reason service not logged locations?
I have no idea. Try it and see.
In logs all the errors are of headless mode. Can you please suggest anything if you have checked logs. Thanks
I see nothing wrong in your logs. You need to tell me the exact time interval where you expected locations but didn't receive them.
I see nothing wrong in your logs. You need to tell me the exact time interval where you expected locations but didn't receive them. I started 8:13 and ended 9:4
Hi Chris, I have removed the enableheadless property and tried another route.
No location logged between 8:18 to 8:45 No locaiton logged between 8:47 to 9:04
Here are the latest logs
Do not spam the thread with large logs, it’s annoying to scroll through. Google “github details tag” and edit your post.
Do not spam the thread with large logs, it’s annoying to scroll through. Google “github details tag” and edit your post.
Done. please check again. Thanks
You have disabled location-services on that device.
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@12512d4
04-24 08:35:37.910 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:36:36.508 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:36:36.643 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@b657d1f
04-24 08:36:36.666 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:38:03.610 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:38:03.675 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@ba4e196
04-24 08:38:03.689 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:38:48.205 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:38:48.267 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@4176ce9
04-24 08:38:48.285 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:39:43.122 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:39:43.188 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@aaf0e88
04-24 08:39:43.206 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:40:58.339 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:40:58.400 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@ff6c3a3
04-24 08:40:58.413 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:41:58.369 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:41:58.446 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@1ac0e2a
04-24 08:41:58.459 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:43:10.160 DEBUG [HeartbeatService onStartCommand] ❤️
04-24 08:43:10.251 ERROR [TSLocationManager getLastLocation]
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@c5347cd
04-24 08:43:10.285 DEBUG [BackgroundGeolocation isMainActivityActive] NO
04-24 08:43:52.435 INFO [TSConfig print]
You have disabled location-services on that device.
‼️ Failed to get last location: com.google.android.gms.tasks.zzu@12512d4 04-24 08:35:37.910 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:36:36.508 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:36:36.643 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@b657d1f 04-24 08:36:36.666 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:38:03.610 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:38:03.675 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@ba4e196 04-24 08:38:03.689 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:38:48.205 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:38:48.267 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@4176ce9 04-24 08:38:48.285 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:39:43.122 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:39:43.188 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@aaf0e88 04-24 08:39:43.206 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:40:58.339 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:40:58.400 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@ff6c3a3 04-24 08:40:58.413 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:41:58.369 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:41:58.446 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@1ac0e2a 04-24 08:41:58.459 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:43:10.160 DEBUG [HeartbeatService onStartCommand] ❤️ 04-24 08:43:10.251 ERROR [TSLocationManager getLastLocation] ‼️ Failed to get last location: com.google.android.gms.tasks.zzu@c5347cd 04-24 08:43:10.285 DEBUG [BackgroundGeolocation isMainActivityActive] NO 04-24 08:43:52.435 INFO [TSConfig print]
For sure my device location service was on, so that there is a location logged in between route. this time I had nokia 6. I checked dumb phone list , its at top position. I followed there suggestions. I force stopped power save mode and tried again. and now locations are getting logged properly.
any suggestions please?
That device is failing to return locations when asked. Not even google maps would work during that period.
That device is failing to return locations when asked. Not even google maps would work during that period.
yes , this has happened with me many times with my nokia device, when google map app failed to return my current location even when my location service was on
will try on another devices. and share if issue happens
Thanks for your support.
Hi Chris, Could you please check what happened this time, I don't see any location failure log I expect locations between 8:35 to 8: 48
Again this time also I used Nokia TA-1021
Another try with Honor 9n device I expect location between 16:24 to 16:28
I want you to install the demo app on your test-devices and test it in parallel with your app. Install it from Play Store
I want you to install the demo app on your test-devices and test it in parallel with your app. Install it from Play Store Thanks Chris for your reply. Definitely I will check with sample app parrelley. But could you please tell what log says
when you see this, your app was restarted:
04-26 16:24:58.387 DEBUG [TrackingService a]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 31******,77****** hAcc=12 et=+19d6h32m10s1ms alt=265.74561914242804 vel=12.117979 bear=57.0 vAcc=23 sAcc=??? bAcc=???], age: 71ms, time: 1556276100000
04-26 16:24:58.395 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
.
. <----------------- Somewhere in here, your app was terminated.
.
04-26 16:28:53.969 INFO [TSConfig print]
╔═════════════════════════════════════════════
║ TSLocationManager version: 3.0.10 (310) <----------------- app restart
╠═════════════════════════════════════════════
{
when you see this, your app was restarted:
04-26 16:24:58.387 DEBUG [TrackingService a] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 31******,77****** hAcc=12 et=+19d6h32m10s1ms alt=265.74561914242804 vel=12.117979 bear=57.0 vAcc=23 sAcc=??? bAcc=???], age: 71ms, time: 1556276100000 04-26 16:24:58.395 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ . . <----------------- Somewhere in here, your app was terminated. . 04-26 16:28:53.969 INFO [TSConfig print] ╔═════════════════════════════════════════════ ║ TSLocationManager version: 3.0.10 (310) <----------------- app restart ╠═════════════════════════════════════════════ {
But I have set stopOnTerminate to false.. I guess service should not imapcted on termination when this setting is false. please correct me if i am wrong
Foreground services are not supposed to terminated by the OS. Foreground services are typically used by music players. Imagine if the OS were randomly deciding to terminate the player in the middle of a song or podcast. This is apparently what happened in your log.
Tested parallel with the sample app on same device(Nokia 6), both apps showed same route
Seems due to low battery, device OS stopped location service in background.
when you see this, your app was restarted:
04-26 16:24:58.387 DEBUG [TrackingService a] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 31******,77****** hAcc=12 et=+19d6h32m10s1ms alt=265.74561914242804 vel=12.117979 bear=57.0 vAcc=23 sAcc=??? bAcc=???], age: 71ms, time: 1556276100000 04-26 16:24:58.395 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ . . <----------------- Somewhere in here, your app was terminated. . 04-26 16:28:53.969 INFO [TSConfig print] ╔═════════════════════════════════════════════ ║ TSLocationManager version: 3.0.10 (310) <----------------- app restart ╠═════════════════════════════════════════════ {
Tested with Android Sample app (downloaded from playstore) Device: NokiA 6
Hi Chris, I was testing sample app and suddenly location service stopped in between traveling (location icon disappeared from top bar. But location provider was enabled) In logs I see 'TSLocationManager version: 3.0.10 (' Please have look on logs background-geolocation.log.gz
I expect locations between 18:48 and 19:00
http://tracker.transistorsoft.com/msgs?device=Cordova-TA-1021&end=2019-5-8&start=2019-5-8
Nokia and Huawei devices are the absolute worst. I regularly test upon a Nokia TA-1027 @8.0.0 and it consistently performs poorly, often rarely initiating tracking. I do not trust Nokia phones at all. You can assume that Nokia phones will perform poorly.
Nokia and Huawei devices are the absolute worst. I regularly test upon a Nokia TA-1027 @8.0.0 and it consistently performs poorly, often rarely initiating tracking. I do not trust Nokia phones at all. You can assume that Nokia phones will perform poorly.
Thanks Chris for your quick reply.
I am agreed those are worst devices.
I was curious because of your this reply
Foreground services are not supposed to terminated by the OS. Foreground services are typically used by music players. Imagine if the OS were randomly deciding to terminate the player in the middle of a song or podcast. This is apparently what happened in your log.
I though its happening only in my app. So in sample app something same happened. Kindly verify so that I can sure about this issue and can close this thread
3.0.3 is released with the fix for pausesLocationUpdatesAutomatically
in addition to many Android bug fixes.
3.0.3 is released with the fix for
pausesLocationUpdatesAutomatically
in addition to many Android bug fixes.
Thanks Chris, for your quick actions. I will update plugin V to 3.03 and will share results
service stopped to capturing location after 7 miles But actual distance was traveled of 25 miles
cordova platform ls
):7.0Plugin config this.config = { debug: true, logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, useSignificantChangesOnly: false, maxDaysToPersist: 14, stopOnTerminate: false, startOnBoot: true, foregroundService: true, desiredAccuracy: 0, enableHeadless: true, autoSync: true, batchSync: true, maxBatchSize: 20, heartbeatInterval: 5, preventSuspend: true, disableElasticity: true, distanceFilter: 10,
this.platform.ready().then(() => { BackgroundGeolocation.onHeartbeat((event) => { let guid = localStorage.getItem("guid"); BackgroundGeolocation.getCurrentPosition({ //samples: 1, persist: true, extras: { guid: guid } }).then((location) => { }); }) BackgroundGeolocation.ready(this.config).then(state => { }) });
Expected Behavior
Location should logged throughout the route
Actual Behavior
Location not logged throughout route or till I called the stop method
Steps to Reproduce
1.Call the start method 2.Terminate/kill the app 3.turn of the internet 4.travel 25 miles
Context
I wanted to log all locations in plugin storage until I call getlocation method