Using the cordova-plugin-geolocation
I'm getting this error on Android:
PositionError {code: 1, message: "Illegal Access"}
I checked the plugins/android.json
file and the permissions are present
{
"xml": "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
"count": 1
},
{
"xml": "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
"count": 1
}
Somehow it got fixed just by doing
cordova plugin rm cordova-plugin-geolocation
and
cordova plugin add cordova-plugin-geolocation
Removing and reinstalling the geolocation plugin didn't solve the problem in my case. I had to remove and reinstall the entire android platform from cordova.
cordova platform rm android
cordova platform add android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With