Android App Crash: Attempt to invoke interface method 'void com.transistorsoft.locationmanager.data.a.f()' on a null object reference
Closed this issue · 1 comments
Your Environment
- Plugin version: Paid Plugin
- Platform: Android
- OS version: 7.0
- Device manufacturer / model: Samsung
Expected Behavior
Actual Behavior
Context
Debug logs
06-11 18:05:53.511 30230-30230/com.docandtrack.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.docandtrack.app, PID: 30230
java.lang.RuntimeException: Unable to stop service com.transistorsoft.locationmanager.BackgroundGeolocationService@6d29594: java.lang.NullPointerException: Attempt to invoke interface method 'void com.transistorsoft.locationmanager.data.a.f()' on a null object reference
at android.app.ActivityThread.handleStopService(ActivityThread.java:3788)
at android.app.ActivityThread.-wrap30(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.transistorsoft.locationmanager.data.a.f()' on a null object reference
at com.transistorsoft.locationmanager.BackgroundGeolocationService.F(Unknown Source)
at com.transistorsoft.locationmanager.BackgroundGeolocationService.onDestroy(Unknown Source)
at android.app.ActivityThread.handleStopService(ActivityThread.java:3771)
at android.app.ActivityThread.-wrap30(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
##Description of the whole case scanario
I have a paid Cordova background geolocation plugin. And I have a few question about it. The developer before me working on this project has had added many packages/plugins in the app and now its too confusing that how your plugin is working in my app.
In package.json file, he had added
"com.transistorsoft.cordova.background-geolocation": "https://github.com/transistorsoft/cordova-background-geolocation.git",
"com.transistorsoft.cordova.background-geolocation-lt": "https://github.com/transistorsoft/cordova-background-geolocation-lt.git”
And similarly,
inside config.xml
<plugin name="com.transistorsoft.cordova.background-geolocation" spec="https://github.com/transistorsoft/cordova-background-geolocation.git" />
But in one of the thread in git issues, I came across Cristocracy commenting, for paid customer, one should not add such line in package.json.
I have the plugin “com.transistorsoft.cordova.background-geolocation” in my plugin folder.
Now the problem I came across was:
Unable to stop service com.transistorsoft.locationmanager.BackgroundGeolocationService@5b4f83d: java.lang.NullPointerException: Attempt to invoke interface method 'void com.transistorsoft.locationmanager.data.a.f()' on a null object reference
But I have configured and started the module.
this.gps.setConfig({
desiredAccuracy: 0,
distanceFilter: 2000,
disableElasticity: true,
stopOnTerminate: false,
url: my url here,
batchSync: true,
maxDaysToPersist: 30,
headers: {
"Authorization": "Token " + this.auth.token()
}
});
this.gps.start();
So, what is wrong with the plugin or am I missing something.
Any help would be highly appreciated.
The plugin is working fine in iOS device.. though, location service permission prompt is shown, but “motion and fitness prompt is not shown"