NativeExpressAdView - 无法加载广告:0

时间:2016-06-15 03:53:44

标签: firebase admob adview native-ads

我使用的是NativeExpressAdView,但我无法在此警告中获得广告:

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

这是我的广告布局:

<?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>

在我的代码中加载广告:

final NativeExpressAdView adView = (NativeExpressAdView) view.findViewById(R.id.adView); 
adView.loadAd(new AdRequest.Builder().build());

Google Play服务版:9.0.2 操作系统:5.0

有人可以帮我解决吗?

1 个答案:

答案 0 :(得分:2)

我在服务器上创建新的Admob横幅后,通过更改广告尺寸来解决此问题。您必须设置广告尺寸属于admob显示的尺寸范围。更小/更大是错误的。目前,我们只能通过硬编码设置广告尺寸,SMART_BANNER无法正常工作。