App does not have the required permissions to get location

6,782 views
Skip to first unread message

Saowaluk Sompong

unread,
Oct 13, 2016, 3:51:12 AM10/13/16
to Google Mobile Ads SDK Developers
Hello,
today I noticed this Log:

com.google.android.gms W/Ads: App does not have the required permissions to get location

my app has in manifest:
 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

and I am testing on Android 5 device (so it shouldn't be about not granting runtime permissions as in Android 6)

I am not using .setLocation(location) but I thought AdMob automatically passes this location data to the SDK anyway, right?

In AdMob the setting "Use location data to improve ad targeting and monetization" is enabled.


What does this Log mean?
Thanks

Vu Chau (Mobile Ads SDK Team)

unread,
Oct 13, 2016, 12:48:41 PM10/13/16
to Google Mobile Ads SDK Developers
Hi Saowaluk,

You are correct that AdMob will pass the location automatically to the SDK.  But first you would need to make sure that you actually have the ACCESS_COARSE_LOCATION permission granted when your app is launched.  You will only need .setLocation() to manually pass in a location, so we can gloss over this. 

Try something like this to check if the permission is granted.  If not, you will have to properly obtain the necessary permission.

Vu Chau
Mobile Ads SDK Team

Saowaluk Sompong

unread,
Oct 13, 2016, 11:03:33 PM10/13/16
to Google Mobile Ads SDK Developers
Hello,
I checked for the location permission as you suggested and it's granted to the App.
But I still get the message log:
W/Ads: App does not have the required permissions to get location

Do you have any other suggestion maybe? or what could be wrong?
Thanks a lot!

Vu Chau (Mobile Ads SDK Team)

unread,
Oct 14, 2016, 11:21:45 AM10/14/16
to Google Mobile Ads SDK Developers
Hi Saowaluk,

If you do try on Marshmallow and implement runtime permission, after the user has approved the permission request, do you still get that error in the log?

Could you send over a minimal zipped project so we could try to replicate that scenario locally? Just want to check if that log is the result of you using Google's location APIs and not properly obtaining permission, or if it is logged even when you are not using any location code.

Thanks,

Vu Chau
Mobile Ads SDK Team

Saowaluk Sompong

unread,
Oct 29, 2016, 2:32:50 PM10/29/16
to Google Mobile Ads SDK Developers
Sorry for the late reply.
I tried on Marshmallow: after the user grants the Location permission, the warning doesn't show anymore in the log.

But on Kitkat and Lollipop I get the warning in the log:

W/Ads: App does not have the required permissions to get location

Vu Chau (Mobile Ads SDK Team)

unread,
Oct 31, 2016, 10:59:41 AM10/31/16
to Google Mobile Ads SDK Developers
Hi Saowaluk,

On Android versions before Marshmallow, you should be seeing the permission prompt at install time. Are you seeing that prompt? Feel free to send over a sample zipped project if you need help.

Vu Chau
Mobile Ads SDK Team

Saowaluk Sompong

unread,
Oct 31, 2016, 10:06:43 PM10/31/16
to Google Mobile Ads SDK Developers
Yes, on Android versions before Marshmallow, when I install the APK manually, I see the permission prompt. And the Location permission is there too.
Also using the APK Analyzer function in Android Studio and checking the Manifest, it shows the Coarse Location permission.

I'll try to prepare sample project to send you too, thanks.

Lisitso

unread,
Jun 23, 2020, 9:41:33 AM6/23/20
to Google Mobile Ads SDK Developers
Hi, any update on the topic? I have the same issue

thank you
L.

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 23, 2020, 11:15:55 AM6/23/20
to andre...@gmail.com, google-adm...@googlegroups.com
Hi Lisitso,

Thank you for bringing these issues to our attention. I see you have another post also open about this. And not sure if the 2 issues are linked so will help on this one and hope that it fixes the other one also.

As stated in the post that you spoke about it would appear that you would want to make sure that your device is on Marshmallow API level or above. As it would seem that anything below that does not support the permission that is needed to run the Admob SDK on those devices.

There appears to be no updates beyond what you see. Also seeing as how it is a very old post. chances are it had been handled as best it can.

Regards,
William Pescherine
Mobile Ads SDK Team

ref:_00D1U1174p._5004Q218gu5:ref

Lisitso

unread,
Jun 23, 2020, 2:09:09 PM6/23/20
to Google Mobile Ads SDK Developers
Hi William,
thank you for your fast reply, really appreciated. Probably too fast.
I want to bring to your attention three things:
1) "as stated in the post that you spoke about it would appear that you would want to make sure that your device is on Marshmallow API level or above"
No, that's absolutely not the point.
I dont want make sure that my device is on Marshmallow API level or above.
I know this information (and my device has android 6)
but the point of the support request is how to deal
with an application that is unable to load native ads, with or without location permission granted.
The error I get it the one reported in this thread.
2) "As it would seem that anything below that does not support the permission that is needed to run the Admob SDK on those devices."
So it seems there are some permissions required by your Sdk. But no documentation was found on how to deal with this.
3) "There appears to be no updates beyond what you see. Also seeing as how it is a very old post. chances are it had been handled as best it can."
Well done, but in my case totally useless. Nevermind.

Thanks anyway,
Best Regards.
L.

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 23, 2020, 3:49:25 PM6/23/20
to andre...@gmail.com, google-adm...@googlegroups.com
Hi Lisitso,

Thank you for responding back with the update. And I have continued to look into this.

So just based on what you have said and based on what I have found. Yeah unfortunately from our end it looks like the SDK back then clearly needed that permission. But doesn't now. And would seem like if trying to go to a lower level would not work. Or would at-least cause some conflicts that I can not give more advice on beyond what we both seem to know.

Yeah and while I know it does not fit into what you are trying to do. Unfortunately that is all I have the ability to really do. As it would appear that we could try to help you somewhat with Android 6. And even that would be very limited. And looks like you know enough to help you on that. I would be hard pressed to find information that would help with the issue of anything beyond that.

I will also be bringing this to our team to see if someone maybe knows something more then what I can find.
Reply all
Reply to author
Forward
0 new messages