android - OnLocationStateChange cordova application crashes -
the application working fetches users location using cordova geolocation plugin, , show location on google maps.
the problem i'm facing when kill app , turn off/on location services settings application crashes.
java.lang.runtimeexception: unable start receiver cordova.plugins.diagnostic$locationproviderchangedreceiver: java.lang.nullpointerexception: attempt invoke virtual method 'void cordova.plugins.diagnostic.notifylocationstatechange()' on null object reference
caused by: java.lang.nullpointerexception: attempt invoke virtual method 'void cordova.plugins.diagnostic.notifylocationstatechange()' on null object reference
screen shot of error got after running app directly android studio
i'm using diagnostic plugin because i'm testing app on api 23 i-e marshmallow, needs run time permissions. if remove diagnostic plugin app crashes starts on marshmallow.
the app runs on api's below 23 , not crashes when turn location services on/off.
advices/suggestions welcomed.
this noted issue #85 in plugin repo , resolved patch release cordova.plugins.diagnostic@3.0.4
:
$ cordova plugin rm cordova.plugins.diagnostic && cordova plugin add cordova.plugins.diagnostic@latest
Comments
Post a Comment