NativeExpressAdView - Failed to load ad: 0

ぐ巨炮叔叔 提交于 2019-12-12 18:19:47

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/37825813/nativeexpressadview-failed-to-load-ad-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!