Failed to retrieve GPS location

android

#1

Hello, I try to use mopub, and I did everything as a guide “Interstitial Integration for Android”, but I have a problem. When I execute my target activity, I take logs:
“D/MoPub: Failed to retrieve GPS location: access appears to be disabled”
“D/MoPub: Loading url: http://…”
"D/MoPub: Ad failed to load"
What am i doing wrong?? Could you help me?


#2

Hey maks_nak,

These are very common logs.

"D/MoPub: Failed to retrieve GPS location: access appears to be disabled"

This line means that MoPub cannot access location services. This is output if location services is not enabled in your app. Location services is not required to be used for MoPub but can lead to better ad targeting and higher eCPMs.

To enable location services in Android, you can request a new instance by calling getSystemService(Context.LOCATION_SERVICE) per android documentation here.

You can use isProviderEnabled(String provider), passing in a provider to check if there are any providers enabled for location services. Here is Android’s reference to LocationManager. If Location services is enabled and location is enabled per our documentation here, MoPub will take up the location data.

You can set up a check to see if location services is enabled per Android similar to this stackoverflow link.

"D/MoPub: Loading url: http://..."
"D/MoPub: Ad failed to load"

There two lines means that your ad is loading and failed to load. This can happen due to a number of things. You may have no fill for the ad unit or it may be another issue causing your ad unit not to fill. In this case, please email support@mopub.com with your username, an outline of this issue, and this forum post linked for context, so that we may troubleshoot your issue.

Let us know if we have answered your questions.

Thanks!


#3

Thanks, I think I understand my mistake.


#4

Hey maka_nsk,

Great! If you have any other issues, please post or send an email to support if it’s an issue more specific to your integration.

Thanks!