TysonSubba
TysonSubba

Reputation: 1382

W/Ads: Received error HTTP response code :400

It's pretty simple question but i am not getting the exact answer why is the ad not loading. White blank banner is shown with no ad inside it. Is it the problem related to ad unit id or app being running on debug or release mode. I am pretty sure about the code i have used in my app because i have played with admob in past days also. I have seen this error first time. Is there anyone with the perfect explanation ?

12-18 15:06:26.921 1773-951/? W/Ads: Received error HTTP response code: 400
12-18 15:06:26.929 809-826/? W/Ads: There was a problem getting an ad response. ErrorCode: 0
12-18 15:06:26.937 809-809/? W/Ads: Failed to load ad: 0 

Xml code :

<com.google.android.gms.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    ads:adSize="BANNER"
    ads:adUnitId="@string/banner_ad_unit_id"/>

MainActivity Code:

MobileAds.initialize(this, "app-id");
AdRequest adRequest = new AdRequest.Builder().build();
    adView.loadAd(adRequest);

Upvotes: 2

Views: 3295

Answers (3)

Maddy Sharma
Maddy Sharma

Reputation: 4956

You just need to visit admob: Google AdMob

After that you need to visit Home tab

Please look into the image addedDescription

Upvotes: 4

MStoner
MStoner

Reputation: 750

When I received this I was mistakenly trying to load using an incorrect ad unit - try changing to one of the test units

Upvotes: 2

AbuQauod
AbuQauod

Reputation: 919

There are few things that could be going wrong:

  1. Switch between Wifi and Mobile Data, and find if you could see the ads [proxy issue].
  2. Check if you are using the correct AdUnit ID.
  3. If you are using a rooted device, check if you have installed any Ad blocking applications.
  4. Make sure you have copied the latest google-services.json from firebase console to your project root directory.
  5. check if your package is blocked by Google AdMob on app console.
  6. try to switch from Google Play Services Ads to Firebase Ads. 7.Uninstalled the google play services update.
  7. if its a new project please wait couple of hours, to reflect the api with google console.

hope these tips could help you.

Upvotes: 2

Related Questions