react-native-background-geolocation icon indicating copy to clipboard operation
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

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

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

  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 14:10 jakub-oone

I think I see what's causing this.

christocracy avatar Oct 18 '24 15:10 christocracy

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

github-actions[bot] avatar Nov 18 '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 02 '24 02:12 github-actions[bot]

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

jakub-oone avatar Jan 03 '25 11:01 jakub-oone

it is back again. I assume according to our Sentry

How often are you seeing this?

christocracy avatar Jan 03 '25 15:01 christocracy

We have not released this version to production yet, so it is just pre-release tests. I can see just one crash.

jakub-oone avatar Jan 03 '25 16:01 jakub-oone

Show me the entire crash log.

christocracy avatar Jan 03 '25 16:01 christocracy

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)

jakub-oone avatar Jan 03 '25 16:01 jakub-oone

You're not providing device / OS info.

christocracy avatar Jan 03 '25 16:01 christocracy

device: SM-A536B (Android 14) + M2004J19C (Android 12) using v.4.18.3

jakub-oone avatar Jan 03 '25 19:01 jakub-oone

And how many devices are you testing upon?

christocracy avatar Jan 03 '25 19:01 christocracy

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).

jakub-oone avatar Jan 06 '25 14:01 jakub-oone

@christocracy this bug is still valid - could you please reopen it?

Buthrakaur avatar Jan 09 '25 10:01 Buthrakaur