react-native-background-geolocation
react-native-background-geolocation copied to clipboard
App is crashing - NullPointerException com.transistorsoft.locationmanager.location.TSLocation in applyExtras
Hello Chris,
we got another error "Attempt to invoke virtual method 'android.os.Bundle android.location.Location.getExtras()' on a null object reference"
Stack trace: NullPointerException Attempt to invoke virtual method 'android.os.Bundle android.location.Location.getExtras()' on a null object reference
com.transistorsoft.locationmanager.location.TSLocation in applyExtras at line 3 com.transistorsoft.locationmanager.service.PolygonGeofencingService in handleGeofencingEvent at line 161 com.transistorsoft.locationmanager.service.PolygonGeofencingService in a at line 3 com.transistorsoft.locationmanager.service.PolygonGeofencingService in $r8$lambda$eNqDkhVR6WpqX_AicdiLstvearQ com.transistorsoft.locationmanager.service.PolygonGeofencingService$$ExternalSyntheticLambda2 in run at line 6 java.util.concurrent.ThreadPoolExecutor in runWorker at line 1145 java.util.concurrent.ThreadPoolExecutor$Worker in run at line 644 java.lang.Thread in run at line 1012
Could you please look at that?
Your Environment
- Plugin version: 4.17.2
- Platform: Android
- OS version: Android 13
- Device manufacturer / model: Samsung / SM-G780G (TP1A.220624.014)
- React Native version (
react-native -v): 0.73.7 - Plugin config
const state:State = await BackgroundGeolocation.ready({
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM,
distanceFilter: 20,
reset: true,
debug: false,
stopOnTerminate: false,
stopOnStationary: false,
startOnBoot: true,
enableHeadless: true,
maxDaysToPersist: 2,
geofenceProximityRadius: 50000,
geofenceInitialTriggerEntry: true,
preventSuspend: true,
disableLocationAuthorizationAlert: true,
locationAuthorizationRequest: 'Always',
useSignificantChangesOnly: false,
geofenceModeHighAccuracy: false,
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
});
Expected Behavior
App is not crashing
Actual Behavior
App is crashing
Steps to Reproduce
- Add some geofences to BackgroundGeolocation.addGeofences(geofences)
- Start monitore polygone
- App crash after some time (randomly)
Context
Debug logs
Logs
PASTE_YOUR_LOGS_HERE
It seems you somehow managed to fire a polygon geofence event but a location failed to be received. This shouldn't be possible.
Are you doing anything interesting while testing this?
Hi, I tried to find something interesting in the event data in our logs. It appears that one of the users denied location permissions and then accepted them back. But he is only one of 11 users with the same error. I haven't seen anything suspicious from other users. :-(
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.