Fail to load native ad express. ErrorCode: 0

onCreate:

MobileAds.initialize(this, "my app id is here" );   

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

XML:

<RelativeLayout
    android:layout_width="320dp"
    android:background="@drawable/shadow"
    android:layout_height="150dp"
    android:id="@+id/addLayout"
    android:layout_marginTop="8dp"
    android:layout_below="@+id/firstSection"
    android:layout_alignLeft="@+id/firstSection"
    android:layout_alignStart="@+id/firstSection"
    android:layout_alignRight="@+id/firstSection"
    android:layout_alignEnd="@+id/firstSection">

    <com.google.android.gms.ads.NativeExpressAdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adUnitId="ca-app-pub-3940256099942544/2177258514" <!-- this is default id for testing -->
        ads:adSize="320x150">
    </com.google.android.gms.ads.NativeExpressAdView>


</RelativeLayout>

Dependencies:

dependencies {

    compile 'com.google.firebase:firebase-ads:11.2.0'

}

Log:

I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("85A477B00D9A767978503D919F676E4C") to get test ads on this device.
W/Ads: There was a problem getting an ad response. ErrorCode: 0
W/Ads: Failed to load ad: 0

Why say me to use addTestDevice if my ads:adUnitId in xml is default id for testing?

Ok I add addTestDevice to ad request,

Log with addTestDevice:

I/Ads: Starting ad request.
I/Ads: This request is sent from a test device.
W/Ads: There was a problem getting an ad response. ErrorCode: 0
W/Ads: Failed to load ad: 0

In xml is default id for testing, it can not be an issue waiting until the ad is created in google server.

My device have internet, is not rooted, has not ad blocker, my admob account work ok with other ads. "my app id is here" is my app id.

链接地址: http://www.djcxy.com/p/32396.html

上一篇: 从NativeExpressAdView转换为横幅

下一篇: 无法加载原生广告快递。 ErrorCode:0