java.lang.SecurityException: UID 10243 does not have Coarse/Fine Location permission in Android 10

Viewed 942

I am getting this exception even though permissions for both are given. Unless I manually go and change one time, the error repeats everytime.If I have given permission manually once from then onwards I am not facing this error

1 Answers

I was getting the same error in a background service. If your case is the same you may give this permission and select "Allow all the time"

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

Can read the documentations here

https://developer.android.com/training/location/permissions?hl=en-419#background

this is my trace:

 Caused by: java.lang.SecurityException: UID 10535 does not have Coarse/Fine Location permission
    at android.os.Parcel.createException(Parcel.java:2071)
    at android.os.Parcel.readException(Parcel.java:2039)
    at android.os.Parcel.readException(Parcel.java:1987)
    at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:3332)
Related