transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.66k stars 426 forks source link

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

Open jakub-oone opened 1 month ago

jakub-oone commented 1 month ago

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

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 commented 1 month ago

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 commented 1 month ago

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

github-actions[bot] commented 1 day ago

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