android–admob获得广告响应. ErrorCode:0无法加载广告:0

android–admob获得广告响应. ErrorCode:0无法加载广告:0,第1张

概述我在这里听到了关于这个错误的许多答案,但我的问题没有解决.每次我运行我的应用程序时都没有广告出现,我在Logcat中收到此错误消息:“Therewasaproblemgettinganadresponse.ErrorCode:0Failedtoloadad:0”这是我的java代码.我错过了什么?privatevoidLoadAds()

我在这里听到了关于这个错误的许多答案,但我的问题没有解决.
每次我运行我的应用程序时都没有广告出现,我在Logcat中收到此错误消息:

“There was a problem getting an ad response. ErrorCode: 0 Failed to load ad:0”

这是我的java代码.我错过了什么?

private voID LoadAds() { AdVIEw mAdVIEw = (AdVIEw) findVIEwByID(R.ID.linearLayoutAdmob); AdRequest adRequest = new AdRequest.Builder().build(); mAdVIEw.loadAd(adRequest);

在这里我的xml布局与最后一行的admob

<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:ads="http://schemas.androID.com/apk/res-auto" xmlns:tools="http://schemas.androID.com/tools" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:orIEntation="vertical" androID:background="@drawable/background_play" tools:context=".MainActivity" ><relativeLayout    androID:ID="@+ID/rlayout1"    androID:layout_wIDth="fill_parent"    androID:layout_height="0px"     androID:padding="5dip"           androID:layout_weight="2.3" >    <com.aapps.find.touchImage        androID:ID="@+ID/gameimage1"        androID:layout_wIDth="fill_parent"        androID:layout_height="fill_parent"        androID:scaleType="fitXY"        androID:src="@drawable/ic_launcher" />    <ImageVIEw        androID:ID="@+ID/hitimage1"        androID:layout_wIDth="50dp"        androID:layout_height="50dp"        androID:src="@drawable/hit"        androID:visibility="invisible" />    <ImageVIEw        androID:ID="@+ID/errorimage1"        androID:layout_wIDth="30dp"        androID:layout_height="30dp"        androID:src="@drawable/miss1"        androID:visibility="invisible" /></relativeLayout><relativeLayout    androID:ID="@+ID/rlayoutprogress"    androID:layout_wIDth="fill_parent"    androID:layout_height="0px"    androID:layout_weight="0.1" >   <com.aapps.find.utility.SaundProgressbar    androID:ID="@+ID/progressbar"        androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"/>   </relativeLayout>   <relativeLayout    androID:ID="@+ID/rlayout2"    androID:padding="5dip"      androID:layout_wIDth="fill_parent"    androID:layout_height="0px"    androID:layout_weight="2.3" >   <com.aapps.find.touchImage        androID:ID="@+ID/gameimage2"        androID:layout_wIDth="fill_parent"        androID:layout_height="fill_parent"        androID:scaleType="fitXY"        androID:src="@drawable/ic_launcher" />    <ImageVIEw        androID:ID="@+ID/hitimage2"        androID:layout_wIDth="50dp"        androID:layout_height="50dp"        androID:src="@drawable/hit"        androID:visibility="invisible" />    <ImageVIEw        androID:ID="@+ID/errorimage2"        androID:layout_wIDth="30dp"        androID:layout_height="30dp"        androID:src="@drawable/miss1"        androID:visibility="invisible" /></relativeLayout><relativeLayout    androID:ID="@+ID/rlstatus"    androID:layout_wIDth="fill_parent"    androID:layout_height="0px"    androID:layout_weight="0.3" >    <TextVIEw        androID:ID="@+ID/scoreCount"        androID:layout_wIDth="wrap_content"        androID:layout_height="fill_parent"        androID:layout_marginleft="15dp"        androID:textSize="16sp"        androID:textStyle="bold"        androID:textcolor="#fffd7a"        androID:layout_centerVertical="true"        androID:layout_centerHorizontal="true"        androID:layout_alignParentleft="true"/>    <TextVIEw        androID:ID="@+ID/hitCount"        androID:layout_wIDth="wrap_content"        androID:layout_height="fill_parent"        androID:textSize="16sp"        androID:textStyle="bold"        androID:textcolor="#fffd7a"        androID:layout_centerVertical="true"        androID:layout_centerHorizontal="true"        androID:layout_marginleft="15dp"        androID:layout_toRightOf="@ID/scoreCount"/>    <ImageVIEw        androID:ID="@+ID/imgSound"        androID:layout_wIDth="wrap_content"        androID:layout_height="fill_parent"        androID:layout_alignParentRight="true"        androID:layout_marginRight="15dp"        androID:src="@drawable/sound" />    <ImageVIEw        androID:ID="@+ID/imgHint"        androID:layout_wIDth="wrap_content"        androID:layout_height="fill_parent"        androID:layout_marginRight="15dp"        androID:layout_toleftOf="@ID/imgSound"        androID:src="@drawable/hint" />    <TextVIEw        androID:ID="@+ID/hintCount"        androID:layout_wIDth="wrap_content"        androID:layout_height="fill_parent"        androID:layout_marginRight="26dp"        androID:textSize="16sp"        androID:textStyle="bold"        androID:layout_centerVertical="true"        androID:layout_centerHorizontal="true"        androID:layout_toleftOf="@ID/imgSound"/></relativeLayout>      <com.Google.androID.gms.ads.AdVIEw    androID:ID="@+ID/linearLayoutAdmob"    androID:layout_wIDth="wrap_content"    androID:layout_height="wrap_content"    androID:layout_centerHorizontal="true"    androID:layout_alignParentBottom="true"    ads:adSize="BANNER"    ads:adUnitID="@string/admob_ID"></com.Google.androID.gms.ads.AdVIEw></linearLayout>

我无法弄清问题是什么.我是androID开发的新手.

解决方法:

这就是谷歌所说的

“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.”

所以基本上你要等几个小时:)

https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/fBe3YL3ffpo

总结

以上是内存溢出为你收集整理的android – admob获得广告响应. ErrorCode:0无法加载广告:0全部内容,希望文章能够帮你解决android – admob获得广告响应. ErrorCode:0无法加载广告:0所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1103416.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存