0

When Admob loads alright on a test device emulator but fails to load an add for the production app with following errors

W/Ads: Received error HTTP response code: 403

W/Ads: There was a problem getting an ad response. ErrorCode: 0

W/Ads: Failed to load ad: 0

 //AdRequest.Builder().addTestDevice("testDeviceId").build(); //loads fine with test
   AdRequest adRequest = new AdRequest.Builder().build(); // this fails with errorCode 0

MainActivity:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

MobileAds.initialize(this, "myappId");
mAdView = (AdView)findViewById(R.id.adView1);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}

Layout:

    <com.google.android.gms.ads.AdView
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      android:id="@+id/adView1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      ads:adSize="BANNER"
      ads:adUnitId="@string/addUnit2">
   </com.google.android.gms.ads.AdView>
Rk R Bairi
  • 1,289
  • 7
  • 15
  • 39

1 Answers1

0

There is another similar question on stack overflow and the accepted answer was as follows:

"It could be that you have only recently created a new Ad Unit ID and requesting for live ads. It could take a few hours for ads to start getting served if that is that case. If you are receiving test ads then your implementation is fine. Just wait a few hours and see if you are able to receive live ads then. If not, can send us your Ad Unit ID for us to look into."

Source: admob getting an ad response. ErrorCode: 0 Failed to load ad:0

How long has the ad been active?

Cam Connor
  • 1,231
  • 2
  • 25
  • 40