Skip to content
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

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

Open
jakub-oone opened this issue Oct 18, 2024 · 2 comments

Comments

@jakub-oone
Copy link

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
@christocracy
Copy link
Member

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?

@jakub-oone
Copy link
Author

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

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