I have added the native express adview from firebase into my app it loads fine when i use the test id provided by them but when i replaced it with my publisher id and unit id,it stops displaying it
LogCat
Starting ad request.
Use AdRequest.Builder.addTestDevice("3C5C50F4B6108021A73AB0588B9E62C0") to get test ads on this device.
There was a problem getting an ad response. ErrorCode: 0
Failed to load ad: 0
Ad is not visible. Not refreshing ad.
Scheduling ad refresh 60000 milliseconds from now.
Code XML
<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_gravity="center_horizontal|center"
ads:adSize="FULL_WIDTHx80"
ads:adUnitId="@string/ad_unit_id">
</com.google.android.gms.ads.NativeExpressAdView>
JAVA
MobileAds.initialize(getApplicationContext(), APIClass.PUBLISHER_ID);
NativeExpressAdView adView = (NativeExpressAdView) findViewById(R.id.adView1);
adView.loadAd(new AdRequest.Builder().build());
Will the ads get displayed when i add publish the app to play store
With Native Ads Express, your NativeExpressAdView size needs to fit in the range of sizes you picked in the AdMob Front-end. In this case, Smart banner is not big enough.
See the Choosing a Size section in the docs for what the ranges are for the Native Ads Express templates. Now see how the sizing of Native Ads Express works, since you chose SMART_BANNER as your size (FULL_WIDTHx80).
Let's say you're running this app on a Nexus 5 in portrait. The smart banner will be sized at
360x50. When you compare that against the requirements for the Native Ads Express templates, you'll see that even the Small template requires a height of 80dp. Because your size doesn't fit the requirements, you won't ever see an ad.Try changing the size to ads:adSize="300x250". That size fits all 3 templates, and so you should get an ad back. I just tested it myself and it worked for your ad unit. For more precise measurements, double check which size you picked on the AdMob front-end, and make sure the width and height of your ad fits within the ranges.
We'll investigate more internally why the error code indicates internal error. This could be surfaced a bit better. However, I'm going to close this issue though for the reasons mentioned above.
Answered from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With