react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Crashing on Android: java.lang.IllegalStateException

Open james-newtracs opened this issue 3 years ago • 1 comments

Android crash in production: java.lang.IllegalStateException

Your Environment

  • Plugin version: 4.4.6
  • Platform: Android
  • OS version: 10
  • Device manufacturer / model: Huawei Mate 20 Pro
  • React Native version (react-native -v): 0.64.1
  • Plugin config
export const backgroundConfig = {
    ...(isIOS ? {
      stationaryRadius: 5,
      distanceFilter: 5,
    } : {
      distanceFilter: 0,
      locationUpdateInterval: 2000,
      fastestLocationUpdateInterval: 1000,
    }),
    desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
    desiredOdometerAccuracy: 100,
    //elasticityMultiplier: 2,
    stopOnTerminate: false,
    foregroundService: true,
    preventSuspend: true,
    persistMode: BackgroundGeolocation.PERSIST_MODE_LOCATION,
    stopTimeout: 5,
    //debug: true,
    autoSync: false,
    disableStopDetection: false,
    pausesLocationUpdatesAutomatically: true,
    //logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
    locationAuthorizationRequest: 'Always',
    backgroundPermissionRationale: {
      title: "Allow {applicationName} to access to this device's location in the background?",
      message: "In order to log trips in the background, please enable '{backgroundPermissionOptionLabel}' location permission",
      positiveAction: "Change to '{backgroundPermissionOptionLabel}'",
      negativeAction: "Cancel"
    },
    //disableLocationAuthorizationAlert: true,
    locationAuthorizationAlert: {
      titleWhenNotEnabled: "Location services are not enabled",
      titleWhenOff: "Location services are not enabled",
      instructions: "To ensure best app experience, please enable 'Always' location permissions in device settings",
      cancelButton: "Cancel",
      settingsButton: "Settings"
    },
  }

Expected Behavior

Shouldnt crash

Actual Behavior

Crashing

Steps to Reproduce

  1. Seen in production, cannot reproduce.

Context

Not sure what the user was doing.

Debug logs

Logs
java.lang.IllegalStateException: 
  at android.database.CursorWindow.nativeGetBlob (Native Method)
  at android.database.CursorWindow.getBlob (CursorWindow.java:434)
  at android.database.AbstractWindowedCursor.getBlob (AbstractWindowedCursor.java:47)
  at com.transistorsoft.locationmanager.data.sqlite.b.a (Unknown Source:12)
  at com.transistorsoft.locationmanager.data.sqlite.b.all (Unknown Source:67)
  at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$w0.run (Unknown Source:10)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:929)

james-newtracs avatar Jul 12 '22 04:07 james-newtracs

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] avatar Sep 21 '22 03:09 stale[bot]