这是一个非常简单的问题,但我没有得到确切的答案,为什么广告没有加载。显示白色空白横幅,其中没有广告。是否与广告单元id或应用程序在调试模式或发布模式下运行有关。我非常确定我在应用程序中使用的代码,因为我在过去的几天里也玩过admob。我第一次看到这个错误。有没有人有完美的解释?
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代码:
<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代码:
MobileAds.initialize(this, "app-id");
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
发布于 2020-09-07 23:19:28
发布于 2017-12-18 17:48:59
有几个地方可能会出错:
希望这些技巧能对你有所帮助。
发布于 2019-09-17 00:44:50
当我收到这封信时,我错误地尝试使用不正确的广告单元加载-尝试更改为其中一个测试单元
https://stackoverflow.com/questions/47865557
复制相似问题