问题
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