react-native-background-geolocation
react-native-background-geolocation copied to clipboard
App is crashing - NullPointerException: Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference
Hello Chris,
we got the error "Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference"
Stack trace: NullPointerException Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference
com.transistorsoft.locationmanager.service.StopTimeoutEvaluator in a at line 1 com.transistorsoft.locationmanager.service.PolygonGeofencingService in c at line 2 com.transistorsoft.locationmanager.service.PolygonGeofencingService in a at line 2 com.transistorsoft.locationmanager.service.PolygonGeofencingService$a in run at line 87 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 this?
Your Environment
- Plugin version: 4.17.2
- Platform: Android
- OS version: Android 12
- Device manufacturer / model: Redmi / M2003J15SC (SP1A.210812.016)
- 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
I think I see what's causing this.
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.
Hi @christocracy, after we updated to version "4.18.3", this bug appeared again. It looks you fixed this bug in 4.17.3 [https://github.com/transistorsoft/react-native-background-geolocation/blob/master/CHANGELOG.md#4173--2024-10-21], but in version 4.18.3 it is back again. I assume according to our Sentry. Please could you check it out? Thx. Jakub
it is back again. I assume according to our Sentry
How often are you seeing this?
We have not released this version to production yet, so it is just pre-release tests. I can see just one crash.
Show me the entire crash log.
I have just this:
java.lang.NullPointerException: Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference at com.transistorsoft.locationmanager.service.StopTimeoutEvaluator.a(SourceFile:1) at com.transistorsoft.locationmanager.service.PolygonGeofencingService.c(SourceFile:2) at com.transistorsoft.locationmanager.service.PolygonGeofencingService.a(SourceFile:2) at com.transistorsoft.locationmanager.service.PolygonGeofencingService$a.run at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)
You're not providing device / OS info.
device: SM-A536B (Android 14) + M2004J19C (Android 12) using v.4.18.3
And how many devices are you testing upon?
Hi, so it looks, we have just 2 users with this crash on our app production with v.4.18.3. And 3 users with some old react-native-background-geolocation version. (2-3 month old).
@christocracy this bug is still valid - could you please reopen it?