Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Admob ads not loading - Failed to load ad: 0

Tags:

android

admob

I am trying to load Admob Native ads. Previously (before app was updated) ads used to show but now they are not showing. I have posted the code, xml and the Logcat below.

Code

NativeExpressAdView adView = (NativeExpressAdView) myView.findViewById(R.id.adView);      AdRequest request = new AdRequest.Builder()             .addTestDevice("5BCFF0AAE83AF424648A954038C71DE6")             .addTestDevice("A5E3E2068BD88202CBC281AD76984BEE")//infocus             .build();      adView.loadAd(request); 

XML

<com.google.android.gms.ads.NativeExpressAdView             android:id="@+id/adView"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginTop="10dp"             ads:adSize="320x150"             ads:adUnitId="ca-app-pub-5059726881726792/6223900262"></com.google.android.gms.ads.NativeExpressAdView> 

Logcat

07-14 20:39:57.349 11508-11508/? W/Ads: Failed to load ad: 0 07-14 20:40:07.373 11508-11663/? W/Ads: There was a problem getting an ad response. ErrorCode: 0  Fail to forward ad response.                                   android.os.DeadObjectException                                       at android.os.BinderProxy.transactNative(Native Method)                                       at android.os.BinderProxy.transact(Binder.java:511)                                       at com.google.android.gms.ads.internal.request.ab.a(:com.google.android.gms:93)                                       at com.google.android.gms.ads.internal.request.service.i.run(:com.google.android.gms:638)                                       at com.google.android.gms.ads.internal.util.u.call(:com.google.android.gms:1055)                                       at com.google.android.gms.ads.internal.util.v.run(:com.google.android.gms:75)                                       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)                                       at java.util.concurrent.FutureTask.run(FutureTask.java:237)                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)                                       at java.lang.Thread.run(Thread.java:818)  07-14 20:40:19.539 1975-4922/? W/Ads: Fail to forward ad response.                                   android.os.DeadObjectException                                       at android.os.BinderProxy.transactNative(Native Method)                                       at android.os.BinderProxy.transact(Binder.java:511)                                       at com.google.android.gms.ads.internal.request.ab.a(:com.google.android.gms:93)                                       at com.google.android.gms.ads.internal.request.service.i.run(:com.google.android.gms:638)                                       at com.google.android.gms.ads.internal.util.u.call(:com.google.android.gms:1055)                                       at com.google.android.gms.ads.internal.util.v.run(:com.google.android.gms:75)                                       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)                                       at java.util.concurrent.FutureTask.run(FutureTask.java:237)                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)                                       at java.lang.Thread.run(Thread.java:818) 
like image 416
akkk Avatar asked Jul 14 '16 15:07

akkk


People also ask

Why is my AdMob ads not showing?

Ads won't show if you haven't integrated the Google Mobile Ads SDK correctly. Is your ad implementation code working properly? Test your implementation code to check that ads can show. You can also use ad inspector to test your app's ad serving.

How long does AdMob take to show ads?

How long does it take for ads to begin appearing after the first ad request? When apps are newly registered with AdMob, it typically takes up to an hour and a few ad requests to allow inventory to build. Because of this, you may not see live impressions immediately. Note: In some cases, it may take longer than an hour.

Why do ads not work on my phone?

MOBILE ADS TROUBLESHOOTINGEnsure you don't have too many apps running in the background. Check to see if there are any privacy settings/settings on your device that restrict you from viewing ads. Check that your Internet provider/region does not restrict ads, or your modem/provider doesn't throttle ads or ad content.


2 Answers

There is no fault in your code. It's all good. You just need to wait a little. Your ad id is newly created so it will take some time to fetch ads from google servers. You can verify this by adding banner/interstitial ad id you creating for earlier applications and you'll see that they work. So give it some time and it will work soon. At least for me, it happens all the time. Can't surely say for you but why not give it a try?

like image 87
user3314639 Avatar answered Sep 16 '22 14:09

user3314639


In my case missing payment information was an issue. When you login to Admob dashboard you will see notice over there which says ads won't work until we add payment details.

like image 25
Hardik Maru Avatar answered Sep 20 '22 14:09

Hardik Maru