Android 6.0 permissions

 java.lang.SecurityException: "passive" location provider requires ACCESS_FINE_LOCATION permission.

This error is most likely related to this:
Basically apps targetting android 6.0 must ask for permissions at run time :frowning:

When targetting sdk 22 or below this error is gone.

I also have a problem with my app running on android 6.0. I haven’t been able to test for myself, but a friend with 6.0 reported the problem to me, although without much info.

This might shed some light, but I don’t know how to fix.

If the device is running Android 6.0 or higher, and your app’s target SDK is 23 or higher: The app has to list the permissions in the manifest, and it must request each dangerous permission it needs while the app is running. The user can grant or deny each permission, and the app can continue to run with limited capabilities even if the user denies a permission request.

I’m targeting SDK 23 which is required for my app that uses extension-admob.

How do I change the permissions in the manifest? Will this solve it, or is there something more?

Do we require location permissions, or is this a native extension?

It’s from native extension if I remember correctly.

In that case, it sounds as if there’s an extra call needed in the Java side at runtime, and extra handling in case the permission is refused

I’m still stuck with this one. Does anyone have a solution?

I don’t use extension-admob myself, but as far as I can tell, it doesn’t use any dangerous permissions. In fact, the AdMob documentation lists exactly two required permissions:

<!-- Include required permissions for Google Mobile Ads to run-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Since these permissions are safe, you don’t need to change anything for them to work on Android 6.0. Are you sure that AdMob is what’s causing your error?

This isn’t much to go on. Did you ever get any more information?

Sorry, I have no useful info, but I think admob is fine. I have the permissions listed and it works fine on < 6.0 devices. I’m only requiring those two permissions and they’re safe, so there’s something else wrong . I need to get an Android 6.0 device to debug this, since I can’t get the emulator working on my AMD win7 machine.

I have a 6.0 device; want to send me a debug build? Feel free to send it as a private message.