Admob Banner ads fail to load, Error Code : 3 No fill

13,555

Solution 1

I've tried combination of devices running with different OS. Finally I got solution. I wrote this code when app was fail with error code 3 (No Fill Error)

<com.google.android.gms.ads.AdView
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="XXXXXXXXXXXXXXXX>
    </com.google.android.gms.ads.AdView> 

Now As per google sample code I've to use width with match_parent so I've changed width with match_parent still same error occurred. So finally I've change Size type with BANNER and now it run in all devices. (Google's demo code use BANNER type) I just tried this size and now all devices run ads banner. Not sure but as per my testing scenario ad was fail which device have large resolution (More than 16:9 ratio like 19:9 ratio 1080 x 2280 pixels) and After Set Banner size type as BANNER works fine with large resolution also.

Solution 2

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

Source: documentation https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#ERROR_CODE_NO_FILL

There is nothing wrong with your code , the issue is admob doesnt always have Ad to return for your request possible reasons could be

-you have just registered your publisher id as it takes some time to start serving ads

-you have filtered some ads

Share:
13,555
Bhavin Chauhan
Author by

Bhavin Chauhan

Updated on June 06, 2022

Comments

  • Bhavin Chauhan
    Bhavin Chauhan almost 2 years

    I've integrated admob Banner & Interstitial in my app. I've noticed that some of ads banner are fail to load. I've debug error code when ads fail to load, Error code is common Error : 3 It mean No fill error. I've added banner and Interstitial ads in 3-4 screens.
    Now Issues is that just one screen banner id is running and all Interstitial are working fine but some of banner not working. (in notch screen).
    When I've change all screens banner id with same which was running proper and all screens working fine for notch screen also.
    I've tested this case in nougat, oreo, marshmello etc. Normal Screen and notch screen.
    I just notice that some of devices running with notch screen are not load all ads. But all normal screens are working fine. So I can't getting exact issue.
    Note: All devices are running with same wifi network when I am testing.
    I don't know if any thing is wrong with other unit id. But all unit id have same settings in my admob account. As per my testing case something is wrong with my AdUnit id. But can't getting what's the issue is.
    I noticed one more case. If I added Testing id in request then it also working. I got device hash from android log.

    I/Ads: Use AdRequest.Builder.addTestDevice("XXXXXXXXXX") to get test ads on this device.
    .addTestDevice("XXXXXXXXXX")


    If any extra debugging technique there it admob account then please share with me so I can check in detail. Can any please help me to check this issue in detail? Please comment if any one need more explanation.

  • Bhavin Chauhan
    Bhavin Chauhan over 5 years
    Thanks for answer. I've read that document. As per your suggestion 1) I don't have register as publisher. 2) Yes I've filtered category but it should be for all unit ids not particular id. So can't getting why only one id is running proper.
  • Swanand Keskar
    Swanand Keskar over 5 years
    it could be the size issue as well as its in different layout , make sure nothing is overlapping the view check this out as well it might help support.google.com/adsense/answer/6191405?hl=en
  • Swanand Keskar
    Swanand Keskar over 5 years
    it could be the size issue as well as its in different layout , make sure nothing is overlapping the view check this out as well it might help support.google.com/adsense/answer/6191405?hl=en
  • Bhavin Chauhan
    Bhavin Chauhan over 5 years
    no size issue there. I've already mentioned when I change that running id to other screen which not working also works fine
  • Bhavin Chauhan
    Bhavin Chauhan over 5 years
    When Just used running id in all screen then all screen load banner ads. So it mean something is monitoring for that id from ad mob account
  • Swanand Keskar
    Swanand Keskar over 5 years
    yeah then issue might be with that id , try creating new one
  • Bhavin Chauhan
    Bhavin Chauhan over 5 years
    yes, I've already did. But this is not solution. Because it was already running proper