Geolocation failed on Android

Hi everyone,

I’m trying to use geolocation on Android (according to official documentation : geolocation doc), and it works fine on web browser but it always throws the following error on Android device :

D/Capacitor: Sending plugin error: 
"error":{"message":"location unavailable"}}

So if someone have an idea…

1 Like

Probably a stupid question, but did you do the permission stuff in AndroidManifest.xml?

Yes as mentioned in the documentation

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />