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

Crash on android: com.transistorsoft.locationmanager.service.GeofencingService.a #1872

Closed
andreshsingh opened this issue Nov 4, 2023 · 7 comments

Comments

@andreshsingh
Copy link

andreshsingh commented Nov 4, 2023

We are experiencing crash on android when geofencing is active and the app is in background.

Your Environment

  • Plugin version:
    "react-native-background-fetch": "^4.2.1",
    "react-native-background-geolocation": "^4.14.3",
  • Platform: Android
  • OS version: android 14
  • Device manufacturer / model: google pixel 7
  • React Native version (react-native -v): 0.72.4
  • Plugin config
    BackgroundGeolocation.ready({
      // Geolocation Config
      startOnBoot: true,
      preventSuspend: true,
      stopOnTerminate: false,
      geofenceModeHighAccuracy: true,
      locationAuthorizationRequest: 'Always',
      disableLocationAuthorizationAlert: true,
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      backgroundPermissionRationale: {
        title: "{applicationName} needs access to location data to enable the GPS tracking feature even when the app is closed or not in use",
        message: "Your location is only tracked while you are on the clock. Please enable {backgroundPermissionOptionLabel} location permission",
        positiveAction: "Change to {backgroundPermissionOptionLabel}",
        negativeAction: "Cancel"
      },
      notification: {
        largeIcon: 'drawable/ic_notification',
        smallIcon: 'drawable/ic_notification'
      },
    })

Expected Behavior

Expected the app to record geofencing and function properly.

Actual Behavior

The app crashes in background.

Steps to Reproduce

  1. Start geofences
  2. Use another app when the app is in background

Context

So the way we use this plugin is tracking the geofences and read the exit/entry events to create more geofences. So the app is supposed to track the user's exit on a geofence and create another circular geofence.

Debug logs

Logs
com.transistorsoft.locationmanager.service.GeofencingService.a
java.lang.NullPointerException - Attempt to invoke virtual method 'boolean com.transistorsoft.locationmanager.geofence.TSGeofence.isPolygon()' on a null object reference
@Mike-Becatti
Copy link

This appears to be happening on a Pixel 7 too, but we haven't captured the error in Crashlytics yet for that device. It seems to happen when stationary after a period of movement. It doesn't happen very consistently but enough that we are delaying the release of our app. We will continue to try and gather more information for you.

@christocracy
Copy link
Member

I have a fix for this in the private repo, branch release-4.14.4.

@andreshsingh
Copy link
Author

do you have plans to release it any time soon ? @christocracy

@christocracy
Copy link
Member

Customers should be using the private repo for access to latest updates instead of installing from npm.

@andreshsingh
Copy link
Author

ok i'll work on using the private repo, thanks!

@onizam95
Copy link

@christocracy how can i access the private-repo my organisation has license.

@christocracy
Copy link
Member

Ask the product admin to login to the Customer Dashboard and grant you access.

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

4 participants