I am currently on android SDK level 29. (Android 10/11)
In my android manifest I grant permissions as such:
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
I also grant location permissions for MainActivity, which is the parent activity for the fragment that uses user location data as such:
<application>
<service
android:name=".ui.MainActivity"
android:foregroundServiceType="location"/>
</application>
However, Compiler still says I am "MISSING_PERMISSION_ACCESS_COARSE_LOCATION"
Does this have something to do with the user having to grant location permissions in the runtime? Also, the reason I need such permissions is for Google Nearby API, which might also need separate background location permissions.
However, as far as my knowledge goes, after adding the two pieces of code above in the Android Manifest, background location permissions should also be granted.
What could be the problem here?