NativeExpressAdView - 无法加载广告:0 [英] NativeExpressAdView - Failed to load ad: 0
问题描述
$ b
06-15 09:47:32.557 13810-14512 / W /广告:获取广告响应时出现问题。 ErrorCode:0 06-15 09:47:32.557 13810-13810 / com.bangdev.wifichua W / Ads:无法加载广告:0
<这是我的广告布局:
<?xml version =1.0encoding =utf-8?> ;
< LinearLayout
xmlns:ads =http://schemas.android.com/apk/res-auto
xmlns:android =http://schemas.android.com / apk / res / android
android:layout_width =match_parent
android:layout_height =wrap_content
android:orientation =vertical>
< com.google.android.gms.ads.NativeExpressAdView
android:id =@ + id / adView
android:layout_width =wrap_content
android:layout_height =wrap_content
ads:adSize =320x150
ads:adUnitId =@ string / unit_ads_id/>
< / LinearLayout>
在我的代码中加载广告:
final NativeExpressAdView adView =(NativeExpressAdView)view.findViewById(R.id.adView);
adView.loadAd(new AdRequest.Builder()。build());
Google Play服务版本:9.0.2
操作系统:5.0
任何人都可以帮我解决它吗?解决方案我解决了这个问题,通过改变大小在服务器上创建新的Admob横幅广告之后。您必须设置广告尺寸属于大小范围admob显示。更小/更大是错误的。目前,我们只能通过硬编码设置广告尺寸,SMART_BANNER将无法正常工作。
I use NativeExpressAdView but I can't get ad within this warning:
06-15 09:47:32.557 13810-14512/com.bangdev.wifichua W/Ads: There was a problem getting an ad response. ErrorCode: 0 06-15 09:47:32.557 13810-13810/com.bangdev.wifichua W/Ads: Failed to load ad: 0
This is my ad layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="320x150"
ads:adUnitId="@string/unit_ads_id"/>
</LinearLayout>
Load ad in my code:
final NativeExpressAdView adView = (NativeExpressAdView) view.findViewById(R.id.adView);
adView.loadAd(new AdRequest.Builder().build());
Google play service version: 9.0.2 OS: 5.0
Anyone can help me to resolve it?
I resolved this problem by change size of Ads after creating new Admob banner on server. You must set ad size belong the size range admob shows. Smaller/ bigger is wrong. At this current time, we can only set ad size by hard-code, SMART_BANNER will not working properly.
这篇关于NativeExpressAdView - 无法加载广告:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!