I am trying to show my location on a GoogleMap but Android Studio reports a fatal error on the following line
savedGoogleMap.isMyLocationEnabled = true
The error message is
Missing permissions required by GoogleMap.setMyLocationEnabled: android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION
The problem is the manifest file already includes both permissions so they are not missing!
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Using the IDE context actions to add the permissions inserts additional .ACCESS___LOCATION to the manifest file but Android Studio still reports the fatal error
The apparent issue is Android Studio is ignoring permissions included in the manifest
Earlier posts e.g. here highlight the need for runtime permission checks
My App checks for the required permissions and if checkSelfPermission is not granted I then request the required permissions
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)
So at this moment my app shows a fatal error but there appears no way to fix it
Can anyone suggest other avenues I might try ?
Update
Despite the fatal error the App builds and launches? It also shows myLocation on the Google map.