Skip to content

[Help Wanted]: bg.BackgroundGeolocation.getCurrentPosition returns before timeout and desiredAccuracy reached #1506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 3 tasks
justChris opened this issue Jun 3, 2025 · 18 comments

Comments

@justChris
Copy link

justChris commented Jun 3, 2025

Required Reading

  • Confirmed

Plugin Version

4.12.0

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Pixel9 Pro Emulator

Device operating-systems(s)

Android 16

What do you require assistance about?

bg.BackgroundGeolocation.getCurrentPosition(desiredAccuracy: 10, timeout: 20) returns with a lower accuracy e.g. 25 meters and does not wait for the timeout to elapse.

What am I doing wrong? How can I wait for the desiredAccuracy or just return the fetched location when the timeout is reached?

[Optional] Plugin Code and/or Config

[Optional] Relevant log output

@christocracy
Copy link
Member

Why do you not post the associated logs?

@justChris
Copy link
Author

justChris commented Jun 3, 2025

Because there aren't any relevant logs. When I call bg.BackgroundGeolocation.getCurrentPosition, bg.BackgroundGeolocation.onLocation fires. Thats it.

Now it gives me accuracy <= desiredAccuracy immediately. But before it did not.

Can I assume that bg.BackgroundGeolocation.getCurrentPosition(desiredAccuracy: 10, timeout: 20) is supposed to wait for the desired accuracy or just return the best fetched accuracy when the timeout is reached?

If yes, the problem before could be sourced in the emulator again.

@justChris
Copy link
Author

justChris commented Jun 3, 2025

Now it happened again. As you can see, the accuracy first is 5.0 and when I call bg.BackgroundGeolocation.getCurrentPosition(desiredAccuracy: 10, timeout: 20) again it suddenly is 49 and then returns 27:

I/TSLocationManager(30689): [c.t.l.l.TSLocationManager a]
I/TSLocationManager(30689): ╔═════════════════════════════════════════════
I/TSLocationManager(30689): ║ getCurrentPosition LocationResult: 6 (29622ms old)
I/TSLocationManager(30689): ╠═════════════════════════════════════════════
I/TSLocationManager(30689): ╟─ 📍  Location[fused 48.858370,2.294480 hAcc=5.0 et=+13h2m52s316ms alt=0.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1748971555191
D/TSLocationManager(30689): [c.t.l.l.TSLocationManager a] Median accuracy: 5.0
D/TSLocationManager(30689): [c.t.l.u.LocationAuthorization withPermission]
D/TSLocationManager(30689):   ℹ️  LocationAuthorization: Permission granted
I/flutter (30689): [location] - [Location {odometer: 0, activity: {confidence: 100, type: still}, extras: {}, battery: {level: 1, is_charging: false}, uuid: 655004e0-3171-48e8-8b2a-698e6d2638da, sample: true, age: 29623, coords: {altitude: 0, heading: -1, latitude: 48.85837, accuracy: 5, heading_accuracy: -1, altitude_accuracy: 0.5, speed_accuracy: 0.5, speed: 0, age: 29637, longitude: 2.29448, ellipsoidal_altitude: 0}, is_moving: false, timestamp: 2025-06-03T17:25:55.191Z}]
I/flutter (30689): position accuracy: 5.0
I/flutter (30689): position speed: 0.0
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   🎾  start [LocationRequestService  startId: 1, eventCount: 1]
I/TSLocationManager(30689): [c.t.l.l.SingleLocationRequest startUpdatingLocation]
I/TSLocationManager(30689):   🔵  [SingleLocationRequest start, action: 2, requestId: 6]
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   ⚙️︎   FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true]
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   🎾  2:6 [LocationRequestService  startId: 2, eventCount: 1]
I/TSLocationManager(30689): [c.t.l.s.LocationRequestService b]
I/TSLocationManager(30689):   ℹ️  Location availability: false
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   ⚙️︎   FINISH [LocationRequestService startId: 2, eventCount: 0, sticky: true]
I/ImeTracker(30689): system_server:7dabe46c: onCancelled at PHASE_CLIENT_ON_CONTROLS_CHANGED
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   🎾  2:6 [LocationRequestService  startId: 3, eventCount: 1]
I/TSLocationManager(30689): [c.t.l.s.LocationRequestService b]
I/TSLocationManager(30689):   ℹ️  Location availability: true
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   ⚙️︎   FINISH [LocationRequestService startId: 3, eventCount: 0, sticky: true]
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   🎾  2:6 [LocationRequestService  startId: 4, eventCount: 1]
I/TSLocationManager(30689): [c.t.l.l.TSLocationManager a]
I/TSLocationManager(30689): ╔═════════════════════════════════════════════
I/TSLocationManager(30689): ║ getCurrentPosition LocationResult: 6 (826ms old)
I/TSLocationManager(30689): ╠═════════════════════════════════════════════
I/TSLocationManager(30689): ╟─ 📍  Location[fused 48.858370,2.294480 hAcc=49.582 et=+13h3m22s38ms alt=0.0 vAcc=0.5], time: 1748971584913
D/TSLocationManager(30689): [c.t.l.l.TSLocationManager a] Median accuracy: 5.0
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   ⚙️︎   FINISH [LocationRequestService startId: 4, eventCount: 0, sticky: true]
I/flutter (30689): [location] - [Location {odometer: 0, activity: {confidence: 100, type: still}, extras: {}, battery: {level: 1, is_charging: false}, uuid: ffcd27a1-fabc-4a03-92cb-47fcd75110f3, sample: true, age: 827, coords: {altitude: 0, heading: -1, latitude: 48.85837, accuracy: 49.58, heading_accuracy: 45, altitude_accuracy: 0.5, speed_accuracy: 1.5, speed: -1, age: 833, longitude: 2.29448, ellipsoidal_altitude: 0}, is_moving: false, timestamp: 2025-06-03T17:26:24.913Z}]
I/flutter (30689): position accuracy: 49.58
I/flutter (30689): position speed: -1.0
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   🎾  2:6 [LocationRequestService  startId: 5, eventCount: 1]
I/TSLocationManager(30689): [c.t.l.l.TSLocationManager a]
I/TSLocationManager(30689): ╔═════════════════════════════════════════════
I/TSLocationManager(30689): ║ getCurrentPosition LocationResult: 6 (10ms old)
I/TSLocationManager(30689): ╠═════════════════════════════════════════════
I/TSLocationManager(30689): ╟─ 📍  Location[fused 48.858370,2.294480 hAcc=27.291 et=+13h3m26s415ms alt=0.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1748971589291
I/TSLocationManager(30689): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager(30689):   🔵  Acquired current position
D/TSLocationManager(30689): [c.t.l.l.TSLocationManager a] Median accuracy: 5.0
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   ⚙️︎   FINISH [LocationRequestService startId: 5, eventCount: 0, sticky: false]
I/TSLocationManager(30689): [c.t.l.d.s.SQLiteLocationDAO persist]
I/TSLocationManager(30689):   ✅  INSERT: e6a049ba-a591-4db2-a125-835b2d5d8e77
I/flutter (30689): aqcuired location
I/flutter (30689): [location] - [Location {odometer: 0, activity: {confidence: 100, type: still}, extras: {}, battery: {level: 1, is_charging: false}, uuid: e6a049ba-a591-4db2-a125-835b2d5d8e77, age: 16, coords: {altitude: 0, heading: -1, latitude: 48.85837, accuracy: 27.29, heading_accuracy: -1, altitude_accuracy: 0.5, speed_accuracy: 0.5, speed: 0, age: 18, longitude: 2.29448, ellipsoidal_altitude: 0}, is_moving: false, timestamp: 2025-06-03T17:26:29.291Z}]
I/flutter (30689): position accuracy: 27.29
I/flutter (30689): position speed: 0.0
D/TSLocationManager(30689): [c.t.l.service.AbstractService b]
D/TSLocationManager(30689):   🎾  STOP [LocationRequestService startId: 6, eventCount: 1]
D/TSLocationManager(30689): [c.t.l.service.AbstractService a]
D/TSLocationManager(30689):   ⚙️︎   FINISH [LocationRequestService startId: 6, eventCount: 0, sticky: false]
W/FirebaseContextProvider(30689): Error getting App Check token. Error: com.google.firebase.FirebaseException: Too many attempts.
D/TSLocationManager(30689): [c.t.l.service.AbstractService f]
D/TSLocationManager(30689):   ⚙️︎  LocationRequestService.stopSelfResult(6): true
D/TSLocationManager(30689): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager(30689):   🔴  LocationRequestService stopped

@christocracy
Copy link
Member

As you can see, the accuracy first is 5.0 and when I call

How old is the first location?

@justChris
Copy link
Author

The log does say that, doesn't it? getCurrentPosition LocationResult: 6 (29622ms old)

@christocracy
Copy link
Member

exactly.

I/TSLocationManager(30689): ╔═════════════════════════════════════════════
I/TSLocationManager(30689): ║ getCurrentPosition LocationResult: 6 (29622ms old)
I/TSLocationManager(30689): ╠═════════════════════════════════════════════
I/TSLocationManager(30689): ╟─ 📍  Location[fused 48.858370,2.294480 hAcc=5.0 et=+13h2m52s316ms alt=0.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1748971555191

The location with accuracy: 5 was from 27 seconds ago.

The location with accuracy: 27 was from 10ms ago.

I/TSLocationManager(30689): ╔═════════════════════════════════════════════
I/TSLocationManager(30689): ║ getCurrentPosition LocationResult: 6 (10ms old)
I/TSLocationManager(30689): ╠═════════════════════════════════════════════
I/TSLocationManager(30689): ╟─ 📍  Location[fused 48.858370,2.294480 hAcc=27.291 et=+13h3m26s415ms alt=0.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1748971589291

The plugin prefers to provide the more recent. A device can move many meters away in 27 seconds.

@justChris
Copy link
Author

But I am requesting an up-to-date location with an accuracy of 10 meters. Why does it return a location with 27m accuracy at all? No matter the age.

@christocracy
Copy link
Member

christocracy commented Jun 3, 2025

Because the plug-in balances both age and accuracy.

Where you were in the past is less relevant than where you were <1s ago.

@justChris
Copy link
Author

But I need a high accurate location at time of request. If I request an accuracy of 10m or better, it should return it, or return the best accurate location it could fetch after the timeout.

Otherwise, how do these parameters make sense then? desiredAccuracy, timeout?

What would you suggest?

@justChris
Copy link
Author

Next example:

I/TSLocationManager( 5861): ╔═════════════════════════════════════════════
I/TSLocationManager( 5861): ║ getCurrentPosition LocationResult: 10 (7ms old)
I/TSLocationManager( 5861): ╠═════════════════════════════════════════════
I/TSLocationManager( 5861): ╟─ 📍  Location[fused 48.858370,2.294480 hAcc=20.524 et=+15h44m54s117ms alt=0.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1748981276993
I/TSLocationManager( 5861): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 5861):   🔵  Acquired current position
D/TSLocationManager( 5861): [c.t.l.l.TSLocationManager a] Median accuracy: 5.0
D/TSLocationManager( 5861): [c.t.l.service.AbstractService a]
D/TSLocationManager( 5861):   ⚙️︎   FINISH [LocationRequestService startId: 5, eventCount: 0, sticky: false]
I/flutter ( 5861): aqcuired location
D/TSLocationManager( 5861): [c.t.l.service.AbstractService b]
D/TSLocationManager( 5861):   🎾  STOP [LocationRequestService startId: 6, eventCount: 1]
D/TSLocationManager( 5861): [c.t.l.service.AbstractService a]
D/TSLocationManager( 5861):   ⚙️︎   FINISH [LocationRequestService startId: 6, eventCount: 0, sticky: false]
I/flutter ( 5861): [location] - [Location {odometer: 0, activity: {confidence: 100, type: still}, extras: {}, battery: {level: 1, is_charging: false}, uuid: 12adaa67-3250-4a96-943b-c0dc0b752e56, age: 9, coords: {altitude: 0, heading: -1, latitude: 48.85837, accuracy: 20.52, heading_accuracy: -1, altitude_accuracy: 0.5, speed_accuracy: 0.5, speed: 0, age: 17, longitude: 2.29448, ellipsoidal_altitude: 0}, is_moving: false, timestamp: 2025-06-03T20:07:56.993Z}]
I/flutter ( 5861): position accuracy: 20.52
I/flutter ( 5861): position speed: 0.0

Age is 7ms, timeout was not reached, returned accuracy is 20m

@christocracy
Copy link
Member

A default of only 3 samples are fetched. Once default 3 samples are fetched, it stops sampling, regardless of where the timeout is.

https://pub.dev/documentation/flutter_background_geolocation/latest/flt_background_geolocation/BackgroundGeolocation/getCurrentPosition.html

@config {int} samples [3]

Sets the maximum number of location-samples to fetch. The plugin will return the Location having the best accuracy. Defaults to 3. Only the final Location will be persisted.

@justChris
Copy link
Author

So the solution would be to increase the number of samples?

@christocracy
Copy link
Member

try it and see

@justChris
Copy link
Author

All right

@justChris
Copy link
Author

I set samples to 100 and desiredAccuracy to 10. It keeps sampling even though it already fetched a sample with the desired accuracy.

That's my call: bg.Location location = await bg.BackgroundGeolocation.getCurrentPosition(desiredAccuracy: 10, samples: 100, persist: false);

here is a short log output:

flutter: [location] - [Location {uuid: 67ABFCE9-91A7-432B-86EF-B283C7D0E801, odometer: 17.0, sample: true, extras: {}, age: 2094, timestamp: 2025-06-04T13:08:01.000Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193223076228105, ellipsoidal_altitude: 210.7, floor: null, heading_accuracy: -1.0, latitude: 51.27070641128322, accuracy: 2.0, altitude_accuracy: 12.33, altitude: 165.1, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]
flutter: [location] THIS IS A SAMPLE
flutter: [location] Count - 52
flutter: [location] - [Location {uuid: CFE689D8-D960-467A-9CE8-9D15FFA380D9, odometer: 17.0, sample: true, extras: {}, age: 3090, timestamp: 2025-06-04T13:08:01.000Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193223076228105, ellipsoidal_altitude: 210.7, floor: null, heading_accuracy: -1.0, latitude: 51.27070641128322, accuracy: 2.0, altitude_accuracy: 12.33, altitude: 165.1, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]
flutter: [location] THIS IS A SAMPLE
flutter: [location] Count - 53
flutter: [location] - [Location {uuid: 673290B0-51DB-41C1-AEB2-CE1A314689D5, odometer: 17.0, sample: true, extras: {}, age: 89, timestamp: 2025-06-04T13:08:05.000Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193223064607682, ellipsoidal_altitude: 210.7, floor: null, heading_accuracy: -1.0, latitude: 51.270706418872244, accuracy: 2.0, altitude_accuracy: 12.24, altitude: 165.1, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]
flutter: [location] THIS IS A SAMPLE
flutter: [location] Count - 54
flutter: [location] - [Location {uuid: BD396C56-39FC-4A21-B4E1-F53636E1CCED, odometer: 17.0, sample: true, extras: {}, age: 105, timestamp: 2025-06-04T13:08:06.000Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193223064570171, ellipsoidal_altitude: 210.7, floor: null, heading_accuracy: -1.0, latitude: 51.27070641889674, accuracy: 2.0, altitude_accuracy: 12.21, altitude: 165.1, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]
flutter: [location] THIS IS A SAMPLE
flutter: [location] Count - 55
flutter: [location] - [Location {uuid: D320631B-8731-4BD7-BE26-C3E4D1FA9E80, odometer: 17.0, extras: {}, age: 520, timestamp: 2025-06-04T13:08:06.000Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193223064570171, ellipsoidal_altitude: 210.7, floor: null, heading_accuracy: -1.0, latitude: 51.27070641889674, accuracy: 2.0, altitude_accuracy: 12.21, altitude: 165.1, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]

The plugin is supposed to return the location when:

  • the desired accuracy is met (immediately)
  • or samples are exhausted (best fetched accuracy)

Is that correct?

@justChris justChris reopened this Jun 4, 2025
@christocracy
Copy link
Member

I'm not interested in flutter [location] output.

Post the plugin's own native logs.

@justChris
Copy link
Author

justChris commented Jun 4, 2025

╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 53 of 100 (88 ms old)
╚═══════════════════════════════════════════════════════════
flutter: [location] - [Location {uuid: 5532F1A5-93B8-4B7E-8A1D-12BA79A20B2A, odometer: 10.4, sample: true, extras: {}, age: 89, timestamp: 2025-06-04T14:26:52.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.19315895413763, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.270690108708024, accuracy: 2.0, altitude_accuracy: 9.77, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════

📍<+51.27069009,+7.19315900> +/- 2.00m (speed 0.00 mps / course -1.00) @ 04.06.2025, 16:26:53 Central European Summer Time

╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 54 of 100 (99 ms old)
╚═══════════════════════════════════════════════════════════
flutter: [location] - [Location {uuid: 590C88B9-CA9B-46AF-952E-C24C5E70181A, odometer: 10.4, sample: true, extras: {}, age: 99, timestamp: 2025-06-04T14:26:53.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193159000042946, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.270690087264434, accuracy: 2.0, altitude_accuracy: 9.67, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]

📍<+51.27069003,+7.19315913> +/- 2.00m (speed 0.00 mps / course -1.00) @ 04.06.2025, 16:26:54 Central European Summer Time

╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 55 of 100 (94 ms old)
╚═══════════════════════════════════════════════════════════
flutter: [location] - [Location {uuid: 078EDFE7-83F6-4251-88A0-15C158679349, odometer: 10.4, sample: true, extras: {}, age: 94, timestamp: 2025-06-04T14:26:54.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193159132594226, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.27069002534619, accuracy: 2.0, altitude_accuracy: 9.45, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]

📍<+51.27068998,+7.19315924> +/- 2.00m (speed 0.00 mps / course -1.00) @ 04.06.2025, 16:26:55 Central European Summer Time

╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 56 of 100 (93 ms old)
╚═══════════════════════════════════════════════════════════
flutter: [location] - [Location {uuid: D2FA57EC-F502-4D70-8109-9AB1C1F71700, odometer: 10.4, sample: true, extras: {}, age: 93, timestamp: 2025-06-04T14:26:55.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.19315923510786, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.27068997745934, accuracy: 2.0, altitude_accuracy: 9.26, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]

📍<+51.27068850,+7.19316239> +/- 2.00m (speed 0.00 mps / course -1.00) @ 04.06.2025, 16:26:56 Central European Summer Time

╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 57 of 100 (94 ms old)
╚═══════════════════════════════════════════════════════════
flutter: [location] - [Location {uuid: 58FDC22A-F94C-481C-9A67-97DAD97E7A28, odometer: 10.4, sample: true, extras: {}, age: 94, timestamp: 2025-06-04T14:26:56.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.193162393829543, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.27068850193614, accuracy: 2.0, altitude_accuracy: 9.52, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]

📍<+51.27068849,+7.19316241> +/- 2.00m (speed 0.00 mps / course -1.00) @ 04.06.2025, 16:26:57 Central European Summer Time

╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 58 of 100 (93 ms old)
╚═══════════════════════════════════════════════════════════
flutter: [location] - [Location {uuid: 206D7102-0AFF-434C-8953-435E0D281F38, odometer: 10.4, sample: true, extras: {}, age: 93, timestamp: 2025-06-04T14:26:57.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.1931624121650515, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.27068849337114, accuracy: 2.0, altitude_accuracy: 9.46, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]
⚠️-[LocationManager onTimeout:] Using last-known location <+51.27068849,+7.19316241> +/- 2.00m (speed 0.00 mps / course -1.00) @ 04.06.2025, 16:26:57 Central European Summer Time
🔴-[LocationManager stopUpdatingLocation] OFF
✅-[LocationManager onTimeout:] Returning best available location sample
🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 3.8
flutter: [location] - [Location {uuid: 0949D1E7-B629-4850-B25D-1799AAC4EBCA, odometer: 10.4, extras: {}, age: 142, timestamp: 2025-06-04T14:26:57.999Z, battery: {level: 1.0, is_charging: true}, coords: {speed_accuracy: 0.31, speed: 0.0, longitude: 7.1931624121650515, ellipsoidal_altitude: 219.41, floor: null, heading_accuracy: -1.0, latitude: 51.27068849337114, accuracy: 2.0, altitude_accuracy: 9.46, altitude: 173.82, heading: -1.0}, is_moving: false, activity: {type: still, confidence: 100}}]
App is being debugged, do not track this hang
Hang detected: 2.79s (debugger attached, not reporting)

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════

At Sample 58 of 100 it returns the location.
This happens only on iOS. Android works fine.

@justChris
Copy link
Author

Have you had a chance to look at the logs yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants