Required Reading
Plugin Version
5.0.1
Flutter Doctor
Demians-Mac-mini hive_mobile % fvm flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.0, on macOS 26.2 25C56 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
Mobile operating-system(s)
Device Manufacturer(s) and Model(s)
Google Pixel 9
Device operating-systems(s)
Android 16
What happened?
Geofencing functionality is fully operational on iOS; however, it fails on Android in both Debug and Release modes. While onLocation events are being captured successfully, the onGeofence listener never fires, despite moving the device across the geofence boundaries.
Expected Behavior
Upon calling addGeofences, the geofences should be registered with the OS. Crossing the 15km radius boundary should trigger the onGeofence callback on Android, consistent with iOS behavior.
Actual Behavior
The logs indicate that the plugin fails to register the geofences with Google Play Services, throwing Error 1000. No geofence events are recorded even after significant physical displacement.
After the last log entry, I changed my location multiple times, but no further logs were printed. I’m sure the location moved outside the geofence and then back inside. This works correctly on iOS.
Package version: flutter_background_geolocation ^5.0.1
License verified successfully (I don’t think this is relevant for debugging. I’ve also followed all steps from the documentation and double-checked them multiple times.)
Plugin Code and/or Config
await bg.BackgroundGeolocation.ready(
bg.Config(
desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
distanceFilter: 5,
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
debug: !Config.isReleaseMode,
stopTimeout: 5,
// heartbeatInterval: heartbeatValue,
logLevel: Config.isReleaseMode
? bg.Config.LOG_LEVEL_OFF
: bg.Config.LOG_LEVEL_VERBOSE,
showsBackgroundLocationIndicator: false,
schedule: _getBackgroundSchedule,
disableLocationAuthorizationAlert: true,
allowIdenticalLocations: true,
locationAuthorizationRequest: 'Never',
locationUpdateInterval: 2000,
fastestLocationUpdateInterval: 1000,
deferTime: 3,
notification: bg.Notification(
title: 'test',
text: 'test',
smallIcon: 'drawable/logo',
color: '#FF0000FF',
channelName: 'Location Service',
priority: bg.NotificationPriority.low,
),
),
);
Relevant log output
LOGS:
D/TSLocationManager( 7573): *** logger.debug changed → true
W/Settings( 7573): Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
D/TSLocationManager( 7573): [c.t.l.l.LocationAuthorization withBackgroundPermission]
D/TSLocationManager( 7573): ℹ️ LocationAuthorization: Permission granted
W/Settings( 7573): Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
I/TSLocationManager( 7573): - Enable: true → true, trackingMode: 1
D/TSLocationManager( 7573): [c.t.l.http.HttpService startMonitoringConnectivityChanges]
D/TSLocationManager( 7573): 🎾 Start monitoring connectivity changes
D/TSLocationManager( 7573): [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
D/TSLocationManager( 7573): 🎾 Start monitoring powersave changes
I/TSLocationManager( 7573): [c.t.l.s.ActivityRecognitionService d]
I/TSLocationManager( 7573): 🎾 Start motion-activity updates
I/TSLocationManager( 7573): [c.t.locationmanager.a.g c]
I/TSLocationManager( 7573): 🔴 Stop heartbeat
W/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager$d a]
W/TSLocationManager( 7573): ⚠️ Failed to start monitoring geofences: 1000: 1000 null
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager d] ℹ️ Persist monitored geofences: []
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager e] ℹ️ Persist monitored polygons: {}
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager a]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ motionchange LocationResult: 2 (79829ms old)
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
I/TSLocationManager( 7573): ╟─ 📍 Location[fused 37.421998,-122.084000 hAcc=5.0 et=+2m15s234ms alt=5.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1769277056685
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager setLocation] isMoving: false | stateChanged: false | timerExpired: true | elapsed: -1 | d: 0.0
W/LocationMetrics( 7573): [Metrics] Clock skew detected or tiny dt
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7573): 🔵 MOTIONCHANGE isMoving=false df=5.0 — resetting short-term filter state
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7573): 🔵 Acquired motionchange position, isMoving: false
I/TSLocationManager( 7573): [c.t.locationmanager.a.t a]
I/TSLocationManager( 7573): ✅ 💾 INSERT: f0343eeb-c306-46ac-a483-deb9323022cb
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion]
D/TSLocationManager( 7573): 🎾 Start monitoring stationary region (radius: 150.0m 37.4219983,-122.084 hAcc=5.0)
I/TSLocationManager( 7573): [c.t.locationmanager.a.f e] ✅
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): 🎾 motionchange [TrackingService startId: 1, eventCount: 1]
I/TSLocationManager( 7573): [c.t.l.service.TrackingService l]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ TrackingService motionchange: false
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): ⚙️︎ FINISH [TrackingService startId: 1, eventCount: 0, sticky: false]
I/TSLocationManager( 7573): [c.t.locationmanager.a.f a]
I/TSLocationManager( 7573): ✅ WORK_LOCATION_40.7649333_-73.9779284
I/TSLocationManager( 7573): [c.t.locationmanager.a.f a]
I/TSLocationManager( 7573): ✅ WORK_LOCATION_37.7781581_-122.4261091
D/TSLocationManager( 7573): [c.t.l.l.LocationAuthorization withBackgroundPermission]
D/TSLocationManager( 7573): ℹ️ LocationAuthorization: Permission granted
I/TSLocationManager( 7573): - Enable: true → true, trackingMode: 1
D/TSLocationManager( 7573): [c.t.l.http.HttpService startMonitoringConnectivityChanges]
D/TSLocationManager( 7573): 🎾 Start monitoring connectivity changes
D/TSLocationManager( 7573): [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
D/TSLocationManager( 7573): 🎾 Start monitoring powersave changes
I/TSLocationManager( 7573): [c.t.l.s.ActivityRecognitionService d]
I/TSLocationManager( 7573): 🎾 Start motion-activity updates
I/TSLocationManager( 7573): [c.t.locationmanager.a.g c]
I/TSLocationManager( 7573): 🔴 Stop heartbeat
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager a]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ motionchange LocationResult: 3 (79916ms old)
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
I/TSLocationManager( 7573): ╟─ 📍 Location[fused 37.421998,-122.084000 hAcc=5.0 et=+2m15s234ms alt=5.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1769277056685
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager setLocation] isMoving: false | stateChanged: false | timerExpired: true | elapsed: -1 | d: 0.0
W/LocationMetrics( 7573): [Metrics] Clock skew detected or tiny dt
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7573): 🔵 MOTIONCHANGE isMoving=false df=5.0 — resetting short-term filter state
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7573): 🔵 Acquired motionchange position, isMoving: false
I/TSLocationManager( 7573): [c.t.locationmanager.a.t a]
I/TSLocationManager( 7573): ✅ 💾 INSERT: e0abe3dc-cb76-4bc1-9f4a-29d047126f7a
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion]
D/TSLocationManager( 7573): 🎾 Start monitoring stationary region (radius: 150.0m 37.4219983,-122.084 hAcc=5.0)
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): 🎾 motionchange [TrackingService startId: 2, eventCount: 1]
I/TSLocationManager( 7573): [c.t.l.service.TrackingService l]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ TrackingService motionchange: false
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): ⚙️︎ FINISH [TrackingService startId: 2, eventCount: 0, sticky: false]
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager a]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ getCurrentPosition LocationResult: 4 (79928ms old)
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
I/TSLocationManager( 7573): ╟─ 📍 Location[fused 37.421998,-122.084000 hAcc=5.0 et=+2m15s234ms alt=5.0 vAcc=0.5 vel=0.0 sAcc=0.5], time: 1769277056685
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager setLocation] isMoving: false | stateChanged: false | timerExpired: true | elapsed: -1 | d: 0.0
I/TSLocationManager( 7573): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7573): 🔵 Acquired current position
[log] Tracking Status changed: TrackingStatus.start
D/TSLocationManager( 7573): [c.t.l.service.AbstractService f]
D/TSLocationManager( 7573): ⚙️︎ TrackingService.stopSelfResult(2): true
D/TSLocationManager( 7573): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7573): 🔴 TrackingService stopped
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager$c run] evaluation buffer timer elapsed
W/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager$d a]
W/TSLocationManager( 7573): ⚠️ Failed to start monitoring geofences: 1000: 1000 null
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager d] ℹ️ Persist monitored geofences: []
D/TSLocationManager( 7573): [c.t.l.g.TSGeofenceManager e] ℹ️ Persist monitored polygons: {}
V/MediaPlayer( 7573): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer( 7573): cleanDrmObj: mDrmObj=null mDrmSessionId=null
W/MediaPlayer( 7573): mediaplayer went away with unhandled events
V/MediaPlayer( 7573): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer( 7573): cleanDrmObj: mDrmObj=null mDrmSessionId=null
W/MediaPlayer( 7573): mediaplayer went away with unhandled events
V/MediaPlayer( 7573): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer( 7573): cleanDrmObj: mDrmObj=null mDrmSessionId=null
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): 🎾 start [ActivityRecognitionService startId: 1, eventCount: 1]
D/TSLocationManager( 7573): [c.t.l.s.ActivityRecognitionService a]
D/TSLocationManager( 7573): 🚘 ️DetectedActivity [type=STILL, confidence=100]
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): ⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false]
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): 🎾 start [ActivityRecognitionService startId: 2, eventCount: 1]
I/TSLocationManager( 7573): [c.t.l.s.ActivityRecognitionService a]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ Motion Transition Result
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
I/TSLocationManager( 7573): ╟─ 🎾 ENTER: still
I/TSLocationManager( 7573): ╚═════════════════════════════════════════════
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): ⚙️︎ FINISH [ActivityRecognitionService startId: 2, eventCount: 0, sticky: false]
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): 🎾 start [ActivityRecognitionService startId: 3, eventCount: 1]
I/TSLocationManager( 7573): [c.t.l.s.ActivityRecognitionService a]
I/TSLocationManager( 7573): ╔═════════════════════════════════════════════
I/TSLocationManager( 7573): ║ Motion Transition Result
I/TSLocationManager( 7573): ╠═════════════════════════════════════════════
I/TSLocationManager( 7573): ╟─ 🎾 ENTER: still
I/TSLocationManager( 7573): ╚═════════════════════════════════════════════
D/TSLocationManager( 7573): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7573): ⚙️︎ FINISH [ActivityRecognitionService startId: 3, eventCount: 0, sticky: false]
D/TSLocationManager( 7573): [c.t.l.service.AbstractService f]
D/TSLocationManager( 7573): ⚙️︎ ActivityRecognitionService.stopSelfResult(3): true
D/TSLocationManager( 7573): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7573): 🔴 ActivityRecognitionService stopped
Required Reading
Plugin Version
5.0.1
Flutter Doctor
Mobile operating-system(s)
Device Manufacturer(s) and Model(s)
Google Pixel 9
Device operating-systems(s)
Android 16
What happened?
Geofencing functionality is fully operational on iOS; however, it fails on Android in both Debug and Release modes. While onLocation events are being captured successfully, the onGeofence listener never fires, despite moving the device across the geofence boundaries.
Expected Behavior
Upon calling addGeofences, the geofences should be registered with the OS. Crossing the 15km radius boundary should trigger the onGeofence callback on Android, consistent with iOS behavior.
Actual Behavior
The logs indicate that the plugin fails to register the geofences with Google Play Services, throwing Error 1000. No geofence events are recorded even after significant physical displacement.
After the last log entry, I changed my location multiple times, but no further logs were printed. I’m sure the location moved outside the geofence and then back inside. This works correctly on iOS.
Package version: flutter_background_geolocation ^5.0.1
License verified successfully (I don’t think this is relevant for debugging. I’ve also followed all steps from the documentation and double-checked them multiple times.)
Plugin Code and/or Config
Relevant log output