cordova-plugin-background-geolocation
cordova-plugin-background-geolocation copied to clipboard
Attempt to get length of null array
I maby not getting how to use it but, I am gonna try to explain.
I am using my xiaomi with android one 10 for testing. I am using ionic with capacitor, but i also try just wiht cordova(last version). I am seting the configuration on the app component and also adding a sucription to onLocation like this:
let config: BackgroundGeolocationConfig = {
locationProvider: BackgroundGeolocationLocationProvider.RAW_PROVIDER,
desiredAccuracy: 0,
stationaryRadius: 20,
distanceFilter: 0.1,
interval: 10000,
fastestInterval: 5000,
activitiesInterval: 10000,
url: "http://192.168.1.128:5000",
startOnBoot: true,
debug: false, // enable this hear sounds for background-geolocation life-cycle.
stopOnTerminate: true, // enable this to clear background location settings when the app terminates
};
this.backgroundGeolocation.setConfig(config);
this.backgroundGeolocation.on(BackgroundGeolocationEvents.location)
.subscribe((location: BackgroundGeolocationResponse) => {
console.log("Latitude: ",location.latitude);
});
I start the background location with a button on my home page, the thing is, I get the first location and then I get the next error and crash:
E/Perf: Fail to get file list io.ionic.starter
getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
Fail to get file list io.ionic.starter
E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
I have no idea of what is this, so can anyone help me, I am doing anything wrong? or is actually a bug.