2016-06-15 69 views
2

我用NativeExpressAdView但我不能這樣的警告中獲得的廣告:NativeExpressAdView - 無法加載廣告:0

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 service版本:9.0.2 操作系統:5.0

任何人都可以幫我解決它?

回答

2

我在服務器上創建新的Admob橫幅後,通過更改廣告的大小解決了此問題。您必須設置廣告尺寸屬於admob展示的尺寸範圍。更小/更大是錯誤的。目前,我們只能通過硬編碼設置廣告尺寸,SMART_BANNER無法正常工作。