"Failed to load ad: 3" with DoubleClick

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?


Solution 1:

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.

Solution 2:

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.

enter image description here

Solution 3:

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.

Solution 4:

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.

Solution 5:

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.

ad mob FAQ re: how long does it take ads to show

Source: https://support.google.com/admob/answer/2993019?hl=en