Admob ads not loading - Failed to load ad: 0 - android

I am trying to load Admob Native ads. Previously (before app was updated) ads used to show but now they are not showing. I have posted the code, xml and the Logcat below.
Code
NativeExpressAdView adView = (NativeExpressAdView) myView.findViewById(R.id.adView);
AdRequest request = new AdRequest.Builder()
.addTestDevice("5BCFF0AAE83AF424648A954038C71DE6")
.addTestDevice("A5E3E2068BD88202CBC281AD76984BEE")//infocus
.build();
adView.loadAd(request);
XML
<com.google.android.gms.ads.NativeExpressAdView
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
ads:adSize="320x150"
ads:adUnitId="ca-app-pub-5059726881726792/6223900262"></com.google.android.gms.ads.NativeExpressAdView>
Logcat
07-14 20:39:57.349 11508-11508/? W/Ads: Failed to load ad: 0
07-14 20:40:07.373 11508-11663/? W/Ads: There was a problem getting an ad response. ErrorCode: 0
Fail to forward ad response.
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:511)
at com.google.android.gms.ads.internal.request.ab.a(:com.google.android.gms:93)
at com.google.android.gms.ads.internal.request.service.i.run(:com.google.android.gms:638)
at com.google.android.gms.ads.internal.util.u.call(:com.google.android.gms:1055)
at com.google.android.gms.ads.internal.util.v.run(:com.google.android.gms:75)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
07-14 20:40:19.539 1975-4922/? W/Ads: Fail to forward ad response.
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:511)
at com.google.android.gms.ads.internal.request.ab.a(:com.google.android.gms:93)
at com.google.android.gms.ads.internal.request.service.i.run(:com.google.android.gms:638)
at com.google.android.gms.ads.internal.util.u.call(:com.google.android.gms:1055)
at com.google.android.gms.ads.internal.util.v.run(:com.google.android.gms:75)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

There is no fault in your code. It's all good. You just need to wait a little. Your ad id is newly created so it will take some time to fetch ads from google servers. You can verify this by adding banner/interstitial ad id you creating for earlier applications and you'll see that they work. So give it some time and it will work soon. At least for me, it happens all the time. Can't surely say for you but why not give it a try?

In my case missing payment information was an issue. When you login to Admob dashboard you will see notice over there which says ads won't work until we add payment details.

Constant Value: 0
This error generally occurs in newly created ads. So wait for few hours for the ads to be loaded.

So I had the same error, I have tried everything listed here first.
Waiting for google to send me an email saying AdMob is active. Done, it took about an hour, in fact, if you log in it will give you the status, then I waited for 48~ hours, and still the same issue
The payment setup was not an issue for me because I got paid from an associated AdSense account before.
Then I read all the possible common setup issues that other users here had. I mostly used the sample Admob App ID
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
And the Sample ad Unit Id given on the Admob getting started page, this way you eliminate issues with your account during development.
I Was fairly sure that I had the configuration correct, but to check I downloaded Google's ad samples from GitHub. This way you can check working code, and pop your Admob App ID in and see if the account is set up correctly
I started playing with the build.gradle of their sample, matching what I got to theirs, just updating and adding my dependencies. then I found it, as soon as I went to targetSdkVersion 30 and compileSdkVersion 30 the error arises. so, for now, I'm on SDK 29, till they fix this. I hope some found this useful
Edit: The issue is reported to google check the status here, and here. it seems to affect Java and Kotlin

It also happens when trying to request an ad from a placement with different type.
For example, banner from interstitial and so on. I hope this will help somenone.

From the Documentation, Error code 0 means Internal error.
public static final int ERROR_CODE_INTERNAL_ERROR
Something happened internally; for instance, an invalid response was
received from the ad server.
Constant Value: 0
This error generally occurs in newly created ads. So wait for few hours for the ads to be loaded.

In my case I had enabled Debug logging for ads previously and this ironically caused them not to work...
Go to your device's settings > Google > Ads > Enable debug logging for ads (Disable)
It can also help if you choose Reset advertising ID on the top.
After this Test Ads started working again.
Good luck!

It also happened to me that error"fail to load ad 0" but there is no problem just wait for sometimes like an hour or 2 or even 5 hours just wait you will get the ads.

You can always run your project on emulator and you will get information about "emulated ad" in your applicaiton

When it works with the sample ad unit Ids your account probably just is not approved yet. Have you created it just now?
Test ads worked right away for me. I had to wait several hours for the "Great news – your account is now approved" mail until my ads worked too. Do not use your own ads for development anyway - you can get your AdMob account blocked for that!
So as soon as the test ads work and you have confirmed that the correct IDs are used for release build you most probably have done everything right and just have to wait
There is also an test App ID "ca-app-pub-3940256099942544~3347511713" but I had no problem to use my own App ID right after creating it.

I had this issues because of AVD settings.
Try to change AVD for debug or try to use real device.

I know this question is from 4 years ago, but I stumbled on this because I was having the same error code. My problem is caused by using my own app-id instead of test app id in the manifest file. Once I changed it to the test-app id, I got error-code 2 instead. It's because DNS is not configured properly in my environment. So anyone having the same issue, make sure you are using correct app id and DNS is configured (Follow this link on how to set it up - Android emulator not able to access the internet)

In my case, the android phone that I used to test is Chinese phone and doesn't come with Google Service installed and have issues sometimes whiel using Google services. I have to manullay uninstall and install it again. And it solves the problem.

I had poor internet connection, and i had to wait sometime to load a video ad.

My two cents: This error also happens when you don't have a working internet connection.

Open the build.gradle file inside your application module directory:
and add this dependency
dependencies {
......
......
implementation 'com.google.android.gms:play-services-ads:19.2.0'
}

Related

Ad mananger is disturbing language strings in arabic but everything works fine in english [duplicate]

I'm setting an ad to my Android application using DoubleClick and can't manage to show the final ad. Can someone help me?
When I test an ad by adding ".addTestDevice("xxx...")" I get the test ad but when I remove this line I get the following error:
W/Ads: No fill from ad server
W/Ads: Failed to load ad: 3
I set my ad like this:
PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();
mPublisherAdView.loadAd(adRequest);
And my publisherView looks like this:
<com.google.android.gms.ads.doubleclick.PublisherAdView
android:id="#+id/pronostics_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
ads:adSize="BANNER"
ads:adUnitId="#string/ad_unit_pronostic">
</com.google.android.gms.ads.doubleclick.PublisherAdView>
What could be wrong?
W/Ads: Failed to load ad: 3
As per the Documentation you are getting the following error code:
public static final int ERROR_CODE_NO_FILL
The ad request was successful, but no ad was returned due to lack of
ad inventory.
Constant Value: 3
Based on the post onFailedToReceiveAd - Ad request successful, but no ad returned due to lack of ad inventory when using admob with adwhirl:
If you are getting this error, then your code is correct. The issue is
that AdMob does not always have an ad to return for every request.
This may happen particularly if you have just registered your AdMob
publisher ID, as it takes some time and multiple requests before the
new ID starts returning ads.
Another reason your fill rate may be low is that you don't have
AdSense backfill enabled, or you have filtered out some ads. Check
your app settings to see if that is the case.
EDIT:
Update app-ads.txt and use "setTestDeviceIds" to test on physical device.
As of time of editing these instructions:
https://developers.google.com/admob/android/test-ads
worked. To test ads I used Demo ad Unit and needed to add the app-ads.txt line and wait for it to be crawled by admob crawler (which alone worked on Android-12 emulator), but still gotten instruction in Logcat to use the "setTestDeviceIds" - code under above link, which turned out to be required to display test ads on physical device connected via USB.
There is one option which helped in our case.
As #blizzard mentioned in your application settings in Google Developer Console there is a section which called "Pricing and Distribution". In this section there is a checkbox "CONTAINS ADS". In our case it was disabled. After enabling we successfully received ads.
I had the same error in my app. I was launching the app in debug configuration. The problem was solved as soon as I run the release version of my app on the same device. In Android Studio just go to Build -> Generate Signed APK and choose the release configuration. Then install release .apk on your device. In debug configuration you can also check whether your test ads appears by adding AdRequest.Builder.addTestDevice("YOUR TEST DEVICE"). If it's ok with ads appearing, it means you just need release configuration.
One new and update answer:
Many apps that were removed this October(2018) for the lack of Privacy Policy are unable to receive ads after they get back in Play Store.
You must use this form to request a "reset" for that app's ads. https://support.google.com/admob/contact/appeal_policy_violation
Took me a few days to realize and find the answer.
Hope you get your ads back.
I hadn't published a version of my app with ads yet.
I was seeing error code 3: ERROR_CODE_NO_FILL after I switched from emulators with a debug version to a real device with the release version (installed through adb shell commands).
I waited 12+ hours and I could see ad requests on the AdMob portal, but no matches (match rate of 0%). I went to the Play Console > Store Presence > Pricing & distribution and switched the radio button for Contains ads to Yes, it has ads. I even tried uploading my app bundle (without publishing) to the Play Console. Neither of these worked.
Various AdMob help articles (including the one linked below) mention that if you've been seeing test ads (ads labeled with "Test Ad"), then your code is working and real ads should work as expected (once they build up inventory).
With that in mind, I went ahead and published my app to the Play Store and once the update was live, I downloaded it via the Play Store app on my real phone and the ads loaded no problem and my match rate is now sitting at 66% on AdMob. From the AdMob FAQ article, it sounds like it typically takes a few hours and could have taken up to 24 hours for ads to start showing.
Source: https://support.google.com/admob/answer/2993019?hl=en
This is a simple WORKAROUND (no solution):
You can install a mediation such as InMobi:
https://developers.google.com/admob/android/mediation/inmobi
In this way, if for whatever reason admob is not showing you ads, you can still show them from other ad networks.
W/Ads: Failed to load ad: 3
It Means that your code is correct but due to less amount of request to the server your ads are not Visible.
To check the Test ADS you Should put the code in loop for some time, and you have to give multiple requests so that your admob receives multiple requests and will load the ads immediately.
Add the below code
for(int i=0;i<1000;i++) {
AdRequest adRequest = new AdRequest
.Builder()
.addTestDevice("B431EE858B5F1986E4D89CA31250F732")
.build();
accountSettingsBinding.adView.loadAd(adRequest);
}
Restart Your application multiple times.
Remove the Loop after you start receiving ads.
Option 1: Go to Settings-> search Reset advertising ID -> click on Reset advertising ID -> OK. You should start receiving Ads now
No search option? Try Option 2
Option 2: Go to Settings->Google->Ads->Reset advertising ID->OK
No Google options in Settings? Try Option 3
Option 3:Look for Google Settings (NOT THE SETTINGS)->Ads->Reset advertising ID
Don't forget to add payment methods on Google AdMod. It was my issue with "Error code 3".
Anyway, when your account Google AdMod will be ready to show ads (for tested device or real users) they send you email that your account verified and ready to work!
After this letter everything should work fine.
I'm just going to leave this here incase it works for someone. After trying all the fixes mentioned in all the forums and posts what worked for me is simply using a global AdRequest object. I would use the same object when calling loadAd on each adView in each Activity. I have seen that it tends to load the same Ad on each AdView regardless of activity but at least now I get ads.
If your published app has no admob and its settings in Google Developer Console (called "Pricing and Distribution") "CONTAINS ADS" is uncheched. Always develop with test id with logcat output.
On new admob version
USE this :
//Load your adView before
adView.setAdListener(new AdListener() {
#Override
public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
Toast.makeText(Your current activity.this, "Ad failed: " + errorCode, Toast.LENGTH_SHORT).show();
}
});
If Ads load on your emulator, meaning that they return test ads, that should mean that there's nothing wrong with your code. Do they load test ads on your phone as well?
If you're able to see test ads on the emulator and test devices, then it usually just means that AdMob (assuming you're using AdMob) is unable to return an Ad due to a lack of Ad inventory. If this is the case, then when looking at the Logcat you should see the line W/Ads: Failed to load ad: 3.
What you should do is plug in an Android phone to your computer, and then in Android Studio click on Logcat, and in the top left you should see some devices to select from. Select your phone if it's listed (it should be). The logcat will now be printing everything your phone is printing. In the filter bar, type in ads to filter out stuff you don't need to see.
Then open your application in your phone, and check the logcat. Make sure your device isn't considered a test device. If you see W/Ads: Failed to load ad: 3 then that should mean that the problem lies with AdMob and not you.
If it doesn't say that and it says something else, then I obviously don't know.
There could be one of the reasons that You might have created your advertise from adMob console by clicking yes that your app is already in playstore and giving url of your live app.Now in that case you wont able to run your ads in any other projects which is having diff package id then the live one(not even test advertise).You have to implement the ads in live project containing same package id and in other case will be getting ad failed to load ad : 3.
Thanks!
Happy coding!
This error can be because of too much reasons.
Try first with testAds ca-app-pub id to avoid admob account issues.
Check that you extends AppCompatActivity in your mainActivity, in my case that was the issue
Also check all this steps again https://developers.google.com/admob/android/quick-start?hl=en-419#import_the_mobile_ads_sdk
It's not a problem. When you first design your application, you can use the test codes provided by AdMob. These codes work great on your emulators and on real devices. But as soon as you publish your application on Google Play, these codes stop working immediately. You need to make your test devices.
https://developers.google.com/admob/android/test-ads
But you can use a life hack to continue using test codes for an already published application. Change the application ID in the build.gradle(android) file to a different name and everything will work. Do not forget to return the old name before publishing the application to the Market.
For those facing future problems.
The information presented here does not exclude what has already been said by others, they are just complements, some more things to be taken into account.
As of Jan 2022, the app setup process has changed in admob. A notification was sent to the console with the following message:
All new apps added to AdMob need to be reviewed and
approved. Make sure your AdMob apps are linked
to a supported app store to prevent ad serving
be interrupted. Linking generates an automatic review of the apps.
1-
As you know, there are two ways to configure an application in admob: Published and Unpublished.
If the app has already been published, and the SDK is implemented correctly, there will be no runtime errors, as long as the adsense policies and google platform
If you haven't published your app yet but want to run and test ads, you need to adhere to best practices.
Add your advertising ID/IDFA from your physical device used for testing on admob > settings > test-devices > create might be a good one.
This will allow you to keep your device as a test, even after publishing in the store.
2-
Do not use AdRequest.Builder.addTestDevice() in your code when you are debugging. It has been discontinued.
For debugging purposes, use RequestConfiguration.Builder.setTestDeviceIds() instead. You will have something like this:
public static final String TEST_J7 = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_GRAN_PRIME = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_XIAOMI = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_EMULATOR = AdRequest.DEVICE_ID_EMULATOR;
// if you don't know the id, look it up in Logcat in a normal request
public void newConfiguration() {
String[] tests = {TEST_EMULATOR, TEST_J7, TEST_GRAN_PRIME, TEST_XIAOMI};
MobileAds.setRequestConfiguration(new RequestConfiguration.Builder()
.setTestDeviceIds(Arrays.asList(tests)).build());
}
3-
Always use test ads to prevent delivery from being suspended:
public static final String TEST_UNIT_BANNER = "ca-app-pub-3940256099942544/6300978111";
public static final String TEST_UNIT_REWARD = "ca-app-pub-3940256099942544/5224354917";
public static final String TEST_UNIT_NATIVE = "ca-app-pub-3940256099942544/2247696110";
public static final String TEST_UNIT_INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";
public void loadAd(boolean is_test_device, String unit) {
if (is_test_device) {
newConfiguration();
}
AdRequest request = new AdRequest.Builder().build();
AdView banner = new AdView(c);
banner.setAdUnitId(is_test_device ? TEST_UNIT_BANNER : unit);
banner.loadAd(request);
//...
InterstitialAd.load(c, is_test_device ? TEST_UNIT_INTERSTITIAL : unit, request, /*callback*/);
//...
RewardedInterstitialAd.load(c, is_test_device ? TEST_UNIT_REWARD : unit, request, /*callback*/);
//...
}
According to the documentation:
Your app will receive limited ad serving until it is approved during the AdMob preparation process. In order for your app to be reviewed and approved by AdMob, you will need to list it on an AdMob-compatible store and link your app to the app store in your AdMob account.
The suspension of ads can last for up to 30 days, or be permanent in case of violation of adsense policies.
4-
After setting up your test device, reset your Advertising ID by going to Settings > Google > Ads > Reset Advertising ID on your physical device.
Don't forget to use your own unit_id in your distribution app.
Learn more here: About app readiness Set up a test device
If error continues last try is create a new placement in admob. This works for me. Without changing anything(except placement id string) else in code ads start displaying.
I've made the stupidest error. Passed app id into MobileAds.initialize from one app and used placement id in loadAd from another admob app.
Once I corrected placement id all come to work.
For me the reason was that one device, a Xiaomi Mi 9 just was not working anymore and not displaying ads, so I pulled out my tablet and I saw no errors and it was displaying ads in the release.
Your ad units are not displaying ads because you haven't yet verified your address (PIN).
Maybe it helps to others, i received this notification on my AdSense account.
W/Ads: Failed to load ad: 3
Means: The ad request was successful, but no ad was returned due to lack of ad inventory.
So, In my case, I have commented the keywords: property to load all types of ads. Now my ad is loading properly.
static final MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
testDevices: testDevice != null ? <String>[testDevice] : null,
nonPersonalizedAds: true,
//keywords: <String>['Fitness', 'Yoga', 'Health', 'Exercise', 'Game', 'Doctor', 'Medical'],);
This works for me
Settings->Google->Ads->Reset advertising ID->OK
But In some cases, ads are automatically come after uploaded to the play store.
Check And Make sure You Have not linked two accounts to adsense as I have mistakenly done in my case.
if you are just creating your admob account waut for 24 hours and try again
My problem was with Payment. I refreshed my payment method and it helped me.
in my case :
I/Ads: Ad failed to load : Account not approved yet.
but you need to implement the listener for knowing the error
First import the listener : import com.google.android.gms.ads.AdListener;
Second create variable : private final String TAG2 = com.ringtones.splash.class.getSimpleName();
mAdView.setAdListener(new AdListener() {
#Override
public void onAdLoaded() {Log.d(TAG2, "google banner ad loaded"); }
#Override
public void onAdFailedToLoad(LoadAdError adError) {Log.d(TAG2, "google banner ad failed to load : "+ adError.getMessage());}
#Override
public void onAdOpened() {Log.d(TAG2, "google banner ad opened");}
#Override
public void onAdClicked() {Log.d(TAG2, "google banner ad clicked");}
#Override
public void onAdLeftApplication() {Log.d(TAG2, "google banner ad left application");}
#Override
public void onAdClosed() {Log.d(TAG2, "google banner ad closed");}
});
I had this problem with device.
My ads worked without problems with UnitID Test Emulator, but when testing on my device it doesn't work with message "failed to load ad: 3"
My solution was to test the app in the internal test environment of Google Play Console creating User Verifiers
Then I downloaded the app on the same device from Google Play internal testing and the ads worked for me, and it worked in production too
In my case this can reproduce if you put wrong ID for the incorrect widget.
example:
you put interstitialAds ID, to AdView Banner widget.
So make sure you put correct ID for the widget.
hope its help.
In my case my Android app was showing ads normally and suddenly stopped serving ads and getting "Failed to load ad: 3" My code is 100% correct and my admob account has no limitations. Finally I logged in to my adsense account which is linked to my admob and found out that adsense stopped serving ads to my app because of identity verification required.
I was getting this error in Flutter. Check the debug console and find this command
Use.RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("")
And copy the device id from list to MobileAdTargetingInfo testDevices and it will work !!!

Android:facebook audience network ads request always failed

I integrated Android FAN v4.24.0 SDK as docs says for testing live ads,but I found when first time to call "adView.loadAd()"(adView is a Adview Object), always received error 1001:" No fill,We are not able to serve ads to this person. Please refer to https://developers.facebook.com/docs/audience-network/faq#a12. If you are integrating Audience Network for the first time, you can use test ads https://developers.facebook.com/docs/audience-network/testing.", then I called "adView.loadAd()" again, ad was filled. What's happening and how to avoid this issue? Anyone can help me?
Upgrade your Facebook SDK to v4.25.0.
Fixed
Fixed no fill on the very first impression when advertising id hasn't been retrieved yet
I was trying with SDK version v4.20.0, v4.24.0 . But I was getting failed again and again.
After using SDK v4.25.0 all ads are being shown.
compile 'com.facebook.android:audience-network-sdk:4.25.0'

How to properly set admob in android? [duplicate]

I'm setting an ad to my Android application using DoubleClick and can't manage to show the final ad. Can someone help me?
When I test an ad by adding ".addTestDevice("xxx...")" I get the test ad but when I remove this line I get the following error:
W/Ads: No fill from ad server
W/Ads: Failed to load ad: 3
I set my ad like this:
PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();
mPublisherAdView.loadAd(adRequest);
And my publisherView looks like this:
<com.google.android.gms.ads.doubleclick.PublisherAdView
android:id="#+id/pronostics_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
ads:adSize="BANNER"
ads:adUnitId="#string/ad_unit_pronostic">
</com.google.android.gms.ads.doubleclick.PublisherAdView>
What could be wrong?
W/Ads: Failed to load ad: 3
As per the Documentation you are getting the following error code:
public static final int ERROR_CODE_NO_FILL
The ad request was successful, but no ad was returned due to lack of
ad inventory.
Constant Value: 3
Based on the post onFailedToReceiveAd - Ad request successful, but no ad returned due to lack of ad inventory when using admob with adwhirl:
If you are getting this error, then your code is correct. The issue is
that AdMob does not always have an ad to return for every request.
This may happen particularly if you have just registered your AdMob
publisher ID, as it takes some time and multiple requests before the
new ID starts returning ads.
Another reason your fill rate may be low is that you don't have
AdSense backfill enabled, or you have filtered out some ads. Check
your app settings to see if that is the case.
EDIT:
Update app-ads.txt and use "setTestDeviceIds" to test on physical device.
As of time of editing these instructions:
https://developers.google.com/admob/android/test-ads
worked. To test ads I used Demo ad Unit and needed to add the app-ads.txt line and wait for it to be crawled by admob crawler (which alone worked on Android-12 emulator), but still gotten instruction in Logcat to use the "setTestDeviceIds" - code under above link, which turned out to be required to display test ads on physical device connected via USB.
There is one option which helped in our case.
As #blizzard mentioned in your application settings in Google Developer Console there is a section which called "Pricing and Distribution". In this section there is a checkbox "CONTAINS ADS". In our case it was disabled. After enabling we successfully received ads.
I had the same error in my app. I was launching the app in debug configuration. The problem was solved as soon as I run the release version of my app on the same device. In Android Studio just go to Build -> Generate Signed APK and choose the release configuration. Then install release .apk on your device. In debug configuration you can also check whether your test ads appears by adding AdRequest.Builder.addTestDevice("YOUR TEST DEVICE"). If it's ok with ads appearing, it means you just need release configuration.
One new and update answer:
Many apps that were removed this October(2018) for the lack of Privacy Policy are unable to receive ads after they get back in Play Store.
You must use this form to request a "reset" for that app's ads. https://support.google.com/admob/contact/appeal_policy_violation
Took me a few days to realize and find the answer.
Hope you get your ads back.
I hadn't published a version of my app with ads yet.
I was seeing error code 3: ERROR_CODE_NO_FILL after I switched from emulators with a debug version to a real device with the release version (installed through adb shell commands).
I waited 12+ hours and I could see ad requests on the AdMob portal, but no matches (match rate of 0%). I went to the Play Console > Store Presence > Pricing & distribution and switched the radio button for Contains ads to Yes, it has ads. I even tried uploading my app bundle (without publishing) to the Play Console. Neither of these worked.
Various AdMob help articles (including the one linked below) mention that if you've been seeing test ads (ads labeled with "Test Ad"), then your code is working and real ads should work as expected (once they build up inventory).
With that in mind, I went ahead and published my app to the Play Store and once the update was live, I downloaded it via the Play Store app on my real phone and the ads loaded no problem and my match rate is now sitting at 66% on AdMob. From the AdMob FAQ article, it sounds like it typically takes a few hours and could have taken up to 24 hours for ads to start showing.
Source: https://support.google.com/admob/answer/2993019?hl=en
This is a simple WORKAROUND (no solution):
You can install a mediation such as InMobi:
https://developers.google.com/admob/android/mediation/inmobi
In this way, if for whatever reason admob is not showing you ads, you can still show them from other ad networks.
W/Ads: Failed to load ad: 3
It Means that your code is correct but due to less amount of request to the server your ads are not Visible.
To check the Test ADS you Should put the code in loop for some time, and you have to give multiple requests so that your admob receives multiple requests and will load the ads immediately.
Add the below code
for(int i=0;i<1000;i++) {
AdRequest adRequest = new AdRequest
.Builder()
.addTestDevice("B431EE858B5F1986E4D89CA31250F732")
.build();
accountSettingsBinding.adView.loadAd(adRequest);
}
Restart Your application multiple times.
Remove the Loop after you start receiving ads.
Option 1: Go to Settings-> search Reset advertising ID -> click on Reset advertising ID -> OK. You should start receiving Ads now
No search option? Try Option 2
Option 2: Go to Settings->Google->Ads->Reset advertising ID->OK
No Google options in Settings? Try Option 3
Option 3:Look for Google Settings (NOT THE SETTINGS)->Ads->Reset advertising ID
Don't forget to add payment methods on Google AdMod. It was my issue with "Error code 3".
Anyway, when your account Google AdMod will be ready to show ads (for tested device or real users) they send you email that your account verified and ready to work!
After this letter everything should work fine.
I'm just going to leave this here incase it works for someone. After trying all the fixes mentioned in all the forums and posts what worked for me is simply using a global AdRequest object. I would use the same object when calling loadAd on each adView in each Activity. I have seen that it tends to load the same Ad on each AdView regardless of activity but at least now I get ads.
If your published app has no admob and its settings in Google Developer Console (called "Pricing and Distribution") "CONTAINS ADS" is uncheched. Always develop with test id with logcat output.
On new admob version
USE this :
//Load your adView before
adView.setAdListener(new AdListener() {
#Override
public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
Toast.makeText(Your current activity.this, "Ad failed: " + errorCode, Toast.LENGTH_SHORT).show();
}
});
If Ads load on your emulator, meaning that they return test ads, that should mean that there's nothing wrong with your code. Do they load test ads on your phone as well?
If you're able to see test ads on the emulator and test devices, then it usually just means that AdMob (assuming you're using AdMob) is unable to return an Ad due to a lack of Ad inventory. If this is the case, then when looking at the Logcat you should see the line W/Ads: Failed to load ad: 3.
What you should do is plug in an Android phone to your computer, and then in Android Studio click on Logcat, and in the top left you should see some devices to select from. Select your phone if it's listed (it should be). The logcat will now be printing everything your phone is printing. In the filter bar, type in ads to filter out stuff you don't need to see.
Then open your application in your phone, and check the logcat. Make sure your device isn't considered a test device. If you see W/Ads: Failed to load ad: 3 then that should mean that the problem lies with AdMob and not you.
If it doesn't say that and it says something else, then I obviously don't know.
There could be one of the reasons that You might have created your advertise from adMob console by clicking yes that your app is already in playstore and giving url of your live app.Now in that case you wont able to run your ads in any other projects which is having diff package id then the live one(not even test advertise).You have to implement the ads in live project containing same package id and in other case will be getting ad failed to load ad : 3.
Thanks!
Happy coding!
This error can be because of too much reasons.
Try first with testAds ca-app-pub id to avoid admob account issues.
Check that you extends AppCompatActivity in your mainActivity, in my case that was the issue
Also check all this steps again https://developers.google.com/admob/android/quick-start?hl=en-419#import_the_mobile_ads_sdk
It's not a problem. When you first design your application, you can use the test codes provided by AdMob. These codes work great on your emulators and on real devices. But as soon as you publish your application on Google Play, these codes stop working immediately. You need to make your test devices.
https://developers.google.com/admob/android/test-ads
But you can use a life hack to continue using test codes for an already published application. Change the application ID in the build.gradle(android) file to a different name and everything will work. Do not forget to return the old name before publishing the application to the Market.
For those facing future problems.
The information presented here does not exclude what has already been said by others, they are just complements, some more things to be taken into account.
As of Jan 2022, the app setup process has changed in admob. A notification was sent to the console with the following message:
All new apps added to AdMob need to be reviewed and
approved. Make sure your AdMob apps are linked
to a supported app store to prevent ad serving
be interrupted. Linking generates an automatic review of the apps.
1-
As you know, there are two ways to configure an application in admob: Published and Unpublished.
If the app has already been published, and the SDK is implemented correctly, there will be no runtime errors, as long as the adsense policies and google platform
If you haven't published your app yet but want to run and test ads, you need to adhere to best practices.
Add your advertising ID/IDFA from your physical device used for testing on admob > settings > test-devices > create might be a good one.
This will allow you to keep your device as a test, even after publishing in the store.
2-
Do not use AdRequest.Builder.addTestDevice() in your code when you are debugging. It has been discontinued.
For debugging purposes, use RequestConfiguration.Builder.setTestDeviceIds() instead. You will have something like this:
public static final String TEST_J7 = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_GRAN_PRIME = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_XIAOMI = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_EMULATOR = AdRequest.DEVICE_ID_EMULATOR;
// if you don't know the id, look it up in Logcat in a normal request
public void newConfiguration() {
String[] tests = {TEST_EMULATOR, TEST_J7, TEST_GRAN_PRIME, TEST_XIAOMI};
MobileAds.setRequestConfiguration(new RequestConfiguration.Builder()
.setTestDeviceIds(Arrays.asList(tests)).build());
}
3-
Always use test ads to prevent delivery from being suspended:
public static final String TEST_UNIT_BANNER = "ca-app-pub-3940256099942544/6300978111";
public static final String TEST_UNIT_REWARD = "ca-app-pub-3940256099942544/5224354917";
public static final String TEST_UNIT_NATIVE = "ca-app-pub-3940256099942544/2247696110";
public static final String TEST_UNIT_INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";
public void loadAd(boolean is_test_device, String unit) {
if (is_test_device) {
newConfiguration();
}
AdRequest request = new AdRequest.Builder().build();
AdView banner = new AdView(c);
banner.setAdUnitId(is_test_device ? TEST_UNIT_BANNER : unit);
banner.loadAd(request);
//...
InterstitialAd.load(c, is_test_device ? TEST_UNIT_INTERSTITIAL : unit, request, /*callback*/);
//...
RewardedInterstitialAd.load(c, is_test_device ? TEST_UNIT_REWARD : unit, request, /*callback*/);
//...
}
According to the documentation:
Your app will receive limited ad serving until it is approved during the AdMob preparation process. In order for your app to be reviewed and approved by AdMob, you will need to list it on an AdMob-compatible store and link your app to the app store in your AdMob account.
The suspension of ads can last for up to 30 days, or be permanent in case of violation of adsense policies.
4-
After setting up your test device, reset your Advertising ID by going to Settings > Google > Ads > Reset Advertising ID on your physical device.
Don't forget to use your own unit_id in your distribution app.
Learn more here: About app readiness Set up a test device
If error continues last try is create a new placement in admob. This works for me. Without changing anything(except placement id string) else in code ads start displaying.
I've made the stupidest error. Passed app id into MobileAds.initialize from one app and used placement id in loadAd from another admob app.
Once I corrected placement id all come to work.
For me the reason was that one device, a Xiaomi Mi 9 just was not working anymore and not displaying ads, so I pulled out my tablet and I saw no errors and it was displaying ads in the release.
Your ad units are not displaying ads because you haven't yet verified your address (PIN).
Maybe it helps to others, i received this notification on my AdSense account.
W/Ads: Failed to load ad: 3
Means: The ad request was successful, but no ad was returned due to lack of ad inventory.
So, In my case, I have commented the keywords: property to load all types of ads. Now my ad is loading properly.
static final MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
testDevices: testDevice != null ? <String>[testDevice] : null,
nonPersonalizedAds: true,
//keywords: <String>['Fitness', 'Yoga', 'Health', 'Exercise', 'Game', 'Doctor', 'Medical'],);
This works for me
Settings->Google->Ads->Reset advertising ID->OK
But In some cases, ads are automatically come after uploaded to the play store.
Check And Make sure You Have not linked two accounts to adsense as I have mistakenly done in my case.
if you are just creating your admob account waut for 24 hours and try again
My problem was with Payment. I refreshed my payment method and it helped me.
in my case :
I/Ads: Ad failed to load : Account not approved yet.
but you need to implement the listener for knowing the error
First import the listener : import com.google.android.gms.ads.AdListener;
Second create variable : private final String TAG2 = com.ringtones.splash.class.getSimpleName();
mAdView.setAdListener(new AdListener() {
#Override
public void onAdLoaded() {Log.d(TAG2, "google banner ad loaded"); }
#Override
public void onAdFailedToLoad(LoadAdError adError) {Log.d(TAG2, "google banner ad failed to load : "+ adError.getMessage());}
#Override
public void onAdOpened() {Log.d(TAG2, "google banner ad opened");}
#Override
public void onAdClicked() {Log.d(TAG2, "google banner ad clicked");}
#Override
public void onAdLeftApplication() {Log.d(TAG2, "google banner ad left application");}
#Override
public void onAdClosed() {Log.d(TAG2, "google banner ad closed");}
});
I had this problem with device.
My ads worked without problems with UnitID Test Emulator, but when testing on my device it doesn't work with message "failed to load ad: 3"
My solution was to test the app in the internal test environment of Google Play Console creating User Verifiers
Then I downloaded the app on the same device from Google Play internal testing and the ads worked for me, and it worked in production too
In my case this can reproduce if you put wrong ID for the incorrect widget.
example:
you put interstitialAds ID, to AdView Banner widget.
So make sure you put correct ID for the widget.
hope its help.
In my case my Android app was showing ads normally and suddenly stopped serving ads and getting "Failed to load ad: 3" My code is 100% correct and my admob account has no limitations. Finally I logged in to my adsense account which is linked to my admob and found out that adsense stopped serving ads to my app because of identity verification required.
I was getting this error in Flutter. Check the debug console and find this command
Use.RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("")
And copy the device id from list to MobileAdTargetingInfo testDevices and it will work !!!

No fill from any mediation ad networks always showing for admob test ads [duplicate]

I'm setting an ad to my Android application using DoubleClick and can't manage to show the final ad. Can someone help me?
When I test an ad by adding ".addTestDevice("xxx...")" I get the test ad but when I remove this line I get the following error:
W/Ads: No fill from ad server
W/Ads: Failed to load ad: 3
I set my ad like this:
PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();
mPublisherAdView.loadAd(adRequest);
And my publisherView looks like this:
<com.google.android.gms.ads.doubleclick.PublisherAdView
android:id="#+id/pronostics_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
ads:adSize="BANNER"
ads:adUnitId="#string/ad_unit_pronostic">
</com.google.android.gms.ads.doubleclick.PublisherAdView>
What could be wrong?
W/Ads: Failed to load ad: 3
As per the Documentation you are getting the following error code:
public static final int ERROR_CODE_NO_FILL
The ad request was successful, but no ad was returned due to lack of
ad inventory.
Constant Value: 3
Based on the post onFailedToReceiveAd - Ad request successful, but no ad returned due to lack of ad inventory when using admob with adwhirl:
If you are getting this error, then your code is correct. The issue is
that AdMob does not always have an ad to return for every request.
This may happen particularly if you have just registered your AdMob
publisher ID, as it takes some time and multiple requests before the
new ID starts returning ads.
Another reason your fill rate may be low is that you don't have
AdSense backfill enabled, or you have filtered out some ads. Check
your app settings to see if that is the case.
EDIT:
Update app-ads.txt and use "setTestDeviceIds" to test on physical device.
As of time of editing these instructions:
https://developers.google.com/admob/android/test-ads
worked. To test ads I used Demo ad Unit and needed to add the app-ads.txt line and wait for it to be crawled by admob crawler (which alone worked on Android-12 emulator), but still gotten instruction in Logcat to use the "setTestDeviceIds" - code under above link, which turned out to be required to display test ads on physical device connected via USB.
There is one option which helped in our case.
As #blizzard mentioned in your application settings in Google Developer Console there is a section which called "Pricing and Distribution". In this section there is a checkbox "CONTAINS ADS". In our case it was disabled. After enabling we successfully received ads.
I had the same error in my app. I was launching the app in debug configuration. The problem was solved as soon as I run the release version of my app on the same device. In Android Studio just go to Build -> Generate Signed APK and choose the release configuration. Then install release .apk on your device. In debug configuration you can also check whether your test ads appears by adding AdRequest.Builder.addTestDevice("YOUR TEST DEVICE"). If it's ok with ads appearing, it means you just need release configuration.
One new and update answer:
Many apps that were removed this October(2018) for the lack of Privacy Policy are unable to receive ads after they get back in Play Store.
You must use this form to request a "reset" for that app's ads. https://support.google.com/admob/contact/appeal_policy_violation
Took me a few days to realize and find the answer.
Hope you get your ads back.
I hadn't published a version of my app with ads yet.
I was seeing error code 3: ERROR_CODE_NO_FILL after I switched from emulators with a debug version to a real device with the release version (installed through adb shell commands).
I waited 12+ hours and I could see ad requests on the AdMob portal, but no matches (match rate of 0%). I went to the Play Console > Store Presence > Pricing & distribution and switched the radio button for Contains ads to Yes, it has ads. I even tried uploading my app bundle (without publishing) to the Play Console. Neither of these worked.
Various AdMob help articles (including the one linked below) mention that if you've been seeing test ads (ads labeled with "Test Ad"), then your code is working and real ads should work as expected (once they build up inventory).
With that in mind, I went ahead and published my app to the Play Store and once the update was live, I downloaded it via the Play Store app on my real phone and the ads loaded no problem and my match rate is now sitting at 66% on AdMob. From the AdMob FAQ article, it sounds like it typically takes a few hours and could have taken up to 24 hours for ads to start showing.
Source: https://support.google.com/admob/answer/2993019?hl=en
This is a simple WORKAROUND (no solution):
You can install a mediation such as InMobi:
https://developers.google.com/admob/android/mediation/inmobi
In this way, if for whatever reason admob is not showing you ads, you can still show them from other ad networks.
W/Ads: Failed to load ad: 3
It Means that your code is correct but due to less amount of request to the server your ads are not Visible.
To check the Test ADS you Should put the code in loop for some time, and you have to give multiple requests so that your admob receives multiple requests and will load the ads immediately.
Add the below code
for(int i=0;i<1000;i++) {
AdRequest adRequest = new AdRequest
.Builder()
.addTestDevice("B431EE858B5F1986E4D89CA31250F732")
.build();
accountSettingsBinding.adView.loadAd(adRequest);
}
Restart Your application multiple times.
Remove the Loop after you start receiving ads.
Option 1: Go to Settings-> search Reset advertising ID -> click on Reset advertising ID -> OK. You should start receiving Ads now
No search option? Try Option 2
Option 2: Go to Settings->Google->Ads->Reset advertising ID->OK
No Google options in Settings? Try Option 3
Option 3:Look for Google Settings (NOT THE SETTINGS)->Ads->Reset advertising ID
Don't forget to add payment methods on Google AdMod. It was my issue with "Error code 3".
Anyway, when your account Google AdMod will be ready to show ads (for tested device or real users) they send you email that your account verified and ready to work!
After this letter everything should work fine.
I'm just going to leave this here incase it works for someone. After trying all the fixes mentioned in all the forums and posts what worked for me is simply using a global AdRequest object. I would use the same object when calling loadAd on each adView in each Activity. I have seen that it tends to load the same Ad on each AdView regardless of activity but at least now I get ads.
If your published app has no admob and its settings in Google Developer Console (called "Pricing and Distribution") "CONTAINS ADS" is uncheched. Always develop with test id with logcat output.
On new admob version
USE this :
//Load your adView before
adView.setAdListener(new AdListener() {
#Override
public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
Toast.makeText(Your current activity.this, "Ad failed: " + errorCode, Toast.LENGTH_SHORT).show();
}
});
If Ads load on your emulator, meaning that they return test ads, that should mean that there's nothing wrong with your code. Do they load test ads on your phone as well?
If you're able to see test ads on the emulator and test devices, then it usually just means that AdMob (assuming you're using AdMob) is unable to return an Ad due to a lack of Ad inventory. If this is the case, then when looking at the Logcat you should see the line W/Ads: Failed to load ad: 3.
What you should do is plug in an Android phone to your computer, and then in Android Studio click on Logcat, and in the top left you should see some devices to select from. Select your phone if it's listed (it should be). The logcat will now be printing everything your phone is printing. In the filter bar, type in ads to filter out stuff you don't need to see.
Then open your application in your phone, and check the logcat. Make sure your device isn't considered a test device. If you see W/Ads: Failed to load ad: 3 then that should mean that the problem lies with AdMob and not you.
If it doesn't say that and it says something else, then I obviously don't know.
There could be one of the reasons that You might have created your advertise from adMob console by clicking yes that your app is already in playstore and giving url of your live app.Now in that case you wont able to run your ads in any other projects which is having diff package id then the live one(not even test advertise).You have to implement the ads in live project containing same package id and in other case will be getting ad failed to load ad : 3.
Thanks!
Happy coding!
This error can be because of too much reasons.
Try first with testAds ca-app-pub id to avoid admob account issues.
Check that you extends AppCompatActivity in your mainActivity, in my case that was the issue
Also check all this steps again https://developers.google.com/admob/android/quick-start?hl=en-419#import_the_mobile_ads_sdk
It's not a problem. When you first design your application, you can use the test codes provided by AdMob. These codes work great on your emulators and on real devices. But as soon as you publish your application on Google Play, these codes stop working immediately. You need to make your test devices.
https://developers.google.com/admob/android/test-ads
But you can use a life hack to continue using test codes for an already published application. Change the application ID in the build.gradle(android) file to a different name and everything will work. Do not forget to return the old name before publishing the application to the Market.
For those facing future problems.
The information presented here does not exclude what has already been said by others, they are just complements, some more things to be taken into account.
As of Jan 2022, the app setup process has changed in admob. A notification was sent to the console with the following message:
All new apps added to AdMob need to be reviewed and
approved. Make sure your AdMob apps are linked
to a supported app store to prevent ad serving
be interrupted. Linking generates an automatic review of the apps.
1-
As you know, there are two ways to configure an application in admob: Published and Unpublished.
If the app has already been published, and the SDK is implemented correctly, there will be no runtime errors, as long as the adsense policies and google platform
If you haven't published your app yet but want to run and test ads, you need to adhere to best practices.
Add your advertising ID/IDFA from your physical device used for testing on admob > settings > test-devices > create might be a good one.
This will allow you to keep your device as a test, even after publishing in the store.
2-
Do not use AdRequest.Builder.addTestDevice() in your code when you are debugging. It has been discontinued.
For debugging purposes, use RequestConfiguration.Builder.setTestDeviceIds() instead. You will have something like this:
public static final String TEST_J7 = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_GRAN_PRIME = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_XIAOMI = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_EMULATOR = AdRequest.DEVICE_ID_EMULATOR;
// if you don't know the id, look it up in Logcat in a normal request
public void newConfiguration() {
String[] tests = {TEST_EMULATOR, TEST_J7, TEST_GRAN_PRIME, TEST_XIAOMI};
MobileAds.setRequestConfiguration(new RequestConfiguration.Builder()
.setTestDeviceIds(Arrays.asList(tests)).build());
}
3-
Always use test ads to prevent delivery from being suspended:
public static final String TEST_UNIT_BANNER = "ca-app-pub-3940256099942544/6300978111";
public static final String TEST_UNIT_REWARD = "ca-app-pub-3940256099942544/5224354917";
public static final String TEST_UNIT_NATIVE = "ca-app-pub-3940256099942544/2247696110";
public static final String TEST_UNIT_INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";
public void loadAd(boolean is_test_device, String unit) {
if (is_test_device) {
newConfiguration();
}
AdRequest request = new AdRequest.Builder().build();
AdView banner = new AdView(c);
banner.setAdUnitId(is_test_device ? TEST_UNIT_BANNER : unit);
banner.loadAd(request);
//...
InterstitialAd.load(c, is_test_device ? TEST_UNIT_INTERSTITIAL : unit, request, /*callback*/);
//...
RewardedInterstitialAd.load(c, is_test_device ? TEST_UNIT_REWARD : unit, request, /*callback*/);
//...
}
According to the documentation:
Your app will receive limited ad serving until it is approved during the AdMob preparation process. In order for your app to be reviewed and approved by AdMob, you will need to list it on an AdMob-compatible store and link your app to the app store in your AdMob account.
The suspension of ads can last for up to 30 days, or be permanent in case of violation of adsense policies.
4-
After setting up your test device, reset your Advertising ID by going to Settings > Google > Ads > Reset Advertising ID on your physical device.
Don't forget to use your own unit_id in your distribution app.
Learn more here: About app readiness Set up a test device
If error continues last try is create a new placement in admob. This works for me. Without changing anything(except placement id string) else in code ads start displaying.
I've made the stupidest error. Passed app id into MobileAds.initialize from one app and used placement id in loadAd from another admob app.
Once I corrected placement id all come to work.
For me the reason was that one device, a Xiaomi Mi 9 just was not working anymore and not displaying ads, so I pulled out my tablet and I saw no errors and it was displaying ads in the release.
Your ad units are not displaying ads because you haven't yet verified your address (PIN).
Maybe it helps to others, i received this notification on my AdSense account.
W/Ads: Failed to load ad: 3
Means: The ad request was successful, but no ad was returned due to lack of ad inventory.
So, In my case, I have commented the keywords: property to load all types of ads. Now my ad is loading properly.
static final MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
testDevices: testDevice != null ? <String>[testDevice] : null,
nonPersonalizedAds: true,
//keywords: <String>['Fitness', 'Yoga', 'Health', 'Exercise', 'Game', 'Doctor', 'Medical'],);
This works for me
Settings->Google->Ads->Reset advertising ID->OK
But In some cases, ads are automatically come after uploaded to the play store.
Check And Make sure You Have not linked two accounts to adsense as I have mistakenly done in my case.
if you are just creating your admob account waut for 24 hours and try again
My problem was with Payment. I refreshed my payment method and it helped me.
in my case :
I/Ads: Ad failed to load : Account not approved yet.
but you need to implement the listener for knowing the error
First import the listener : import com.google.android.gms.ads.AdListener;
Second create variable : private final String TAG2 = com.ringtones.splash.class.getSimpleName();
mAdView.setAdListener(new AdListener() {
#Override
public void onAdLoaded() {Log.d(TAG2, "google banner ad loaded"); }
#Override
public void onAdFailedToLoad(LoadAdError adError) {Log.d(TAG2, "google banner ad failed to load : "+ adError.getMessage());}
#Override
public void onAdOpened() {Log.d(TAG2, "google banner ad opened");}
#Override
public void onAdClicked() {Log.d(TAG2, "google banner ad clicked");}
#Override
public void onAdLeftApplication() {Log.d(TAG2, "google banner ad left application");}
#Override
public void onAdClosed() {Log.d(TAG2, "google banner ad closed");}
});
I had this problem with device.
My ads worked without problems with UnitID Test Emulator, but when testing on my device it doesn't work with message "failed to load ad: 3"
My solution was to test the app in the internal test environment of Google Play Console creating User Verifiers
Then I downloaded the app on the same device from Google Play internal testing and the ads worked for me, and it worked in production too
In my case this can reproduce if you put wrong ID for the incorrect widget.
example:
you put interstitialAds ID, to AdView Banner widget.
So make sure you put correct ID for the widget.
hope its help.
In my case my Android app was showing ads normally and suddenly stopped serving ads and getting "Failed to load ad: 3" My code is 100% correct and my admob account has no limitations. Finally I logged in to my adsense account which is linked to my admob and found out that adsense stopped serving ads to my app because of identity verification required.
I was getting this error in Flutter. Check the debug console and find this command
Use.RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("")
And copy the device id from list to MobileAdTargetingInfo testDevices and it will work !!!

onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory when using admob with adwhirl

i just want to know if this problem is server side...or i must fix something in my code...
onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory
I'm using admob with adwhirl to show ads in my android application.
If you are getting this error, then your code is correct. The issue is that AdMob does not always have an ad to return for every request. This may happen particularly if you have just registered your AdMob publisher ID, as it takes some time and multiple requests before the new ID starts returning ads.
Another reason your fill rate may be low is that you don't have AdSense backfill enabled, or you have filtered out some ads. Check your app settings to see if that is the case.
Finally, a test you can run to see if your AdWhirl code is implemented correctly is to request a test ad. You can do this by specifying test mode in AdWhirl:
AdWhirlTargeting.setTestMode(true);
If you get back a test ad, you'll know your code is working as intended.
One of the solutions you could try:
Some times this will happened if you changed language of your Android device to exotic language (Russian for example). Try to change it back to English and AdMob will find appropriate ad for you. Or you could go to the Google Settings->Ads->Reset advertising ID
I've just found that such error is shown if your AdMob account has been banned. But it works with a test device ID.
Note that this might happen aswell if you're using (forcing) a custom width and height for the banners.
You should use the ones that DOC states:
https://developers.google.com/mobile-ads-sdk/docs/admob/intermediate#play
If you set a custom width and height like:
new AdSize( 521,300 );
It's going to reply with the error you mentioned.
I know this was from long time ago, but here's something i did which solved this problem.
1. on your admob account, click on "manage settings" in the app you've created.
2. click on "edit".
3. under "Android Package URL:" leave blank, and then save settings.
*after you'll save, it'll show this box as "market://", which is fine.
I had this problem when using Rewarded Interstitial (beta).
Changing to Rewarded solved the problem.

Categories

Resources