react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

App is crashing - NullPointerException com.transistorsoft.locationmanager.location.TSLocation in applyExtras

Open jakub-oone opened this issue 1 year ago • 1 comments

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

  1. Add some geofences to BackgroundGeolocation.addGeofences(geofences)
  2. Start monitore polygone
  3. App crash after some time (randomly)

Context

Debug logs

Logs
PASTE_YOUR_LOGS_HERE

jakub-oone avatar Oct 18 '24 15:10 jakub-oone

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?

christocracy avatar Oct 18 '24 15:10 christocracy

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. :-(

jakub-oone avatar Oct 21 '24 11:10 jakub-oone

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Nov 21 '24 02:11 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 05 '24 02:12 github-actions[bot]