NativeExpressAdView - Failed to load ad: 0
See original GitHub issueI 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="SMART_BANNER"
ads:adUnitId="ca-app-pub-4793975677981221/2700177593"/>
</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
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Admob ads not loading - Failed to load ad: 0 - Stack Overflow
I have posted the code, xml and the Logcat below. Code NativeExpressAdView adView = (NativeExpressAdView) myView.findViewById(R.id.adView); ...
Read more >Problem with Native Ads Failed to load ad: 0 - Google Groups
to Google Mobile Ads SDK Developers. I've been trying to integrate Native ads to my app but for some reason I get the...
Read more >Android – Admob ads not loading – Failed to load ad: 0 – iTecNote
I am trying to load Admob Native ads. Previously (before app was updated) ads used to show but now they are not showing....
Read more >admob::NativeExpressAdView Class Reference - Firebase
Each NativeExpressAdView object corresponds to a single AdMob Native Express ad placement. There are methods to load an ad, move it, show it...
Read more >SDK Migration | Android - Google Developers
Starting from version 21.0.0, the Google Mobile Ads SDK requires all apps to be ... in all the APIs that previously did not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 Smart Banners works, since you chose SMART_BANNER as your size.
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.
Re: Try changing the size to ads:adSize=“300x250”.
Is there a list of supported ad sizes somewhere?
Is it true (seems to be) that the “test unit id” suggested in the documentation – “ca-app-pub-3940256099942544/2177258514” – only supports the larger sizes (e.g. 300x250, 360x320)?
If so (about the test unit id), then there is no good way to test “small” sized native ads – since developers are not supposed to not only click on ads, but also even display them on their own devices?
Re: We’ll investigate more internally why the error code indicates internal error.
Still getting this in firebase-ads:11.0.1 - comes back with “Error 0”, which does not seem helpful.
Any chance for a proper error message?