Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

admob not showing in app (emulator or device)

Tags:

android

admob

I try to add admob, but I have some problem with it. This is the code for the test, it looks ok:

AdView adView = new AdView(this, AdSize.BANNER, pubID);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);               // Emulator
adRequest.addTestDevice("TEST_DEVICE_ID"); 
adView.loadAd(adRequest);

And this code with pubID

AdView adView = new AdView(this, AdSize.BANNER, pubID);
adView.loadAd(new AdRequest());

I can't understand what's wrong... Just admob is not showing. That's all...
Can anyone help me with this problem? Regards, Peter.

UPD oh sorry. Also all settings set in manifest file( permission , and adsense activity)

upd all response from admob in logcat :

01-11 21:49:31.805: I/Ads(363): To get test ads on this device, call adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
01-11 21:49:33.405: I/Ads(363): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":0,"u_sd":1,"slotname":"a14f0d9ca22bc53","u_w":320,"msid":"activityM.activity.com","simulator":1,"cap":"m,a","js":"afma-sdk-a-v4.3.1","isu":"B3EEABB8EE11C2BE770B684D95219ECB","cipa":0,"format":"320x50_mb","net":"ed","app_name":"1.android.activityM.activity.com","hl":"en","u_h":480,"u_audio":4});</script></head><body></body></html>
01-11 21:49:41.714: I/Ads(363): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&u_sd=1&slotname=a14f0d9ca22bc53&u_w=320&msid=activityM.activity.com&cap=m%2Ca&js=afma-sdk-a-v4.3.1&isu=B3EEABB8EE11C2BE770B684D95219ECB&cipa=0&format=320x50_mb&net=ed&app_name=1.android.activityM.activity.com&hl=en&u_h=480&u_audio=4&u_so=p&output=html&region=mobile_app&u_tz=0&ex=1&client_sdk=1&pto=0&jsv=1", "afmaNotifyDt": "null">
01-11 21:49:42.255: I/Ads(363): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)

That's all what i found in ddms.

like image 726
Peter Avatar asked Jan 26 '26 15:01

Peter


2 Answers

This tells all.

01-11 21:49:42.255: I/Ads(363): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)

This has happened to me sometimes. They just don't have any ads to send out at the moment for whatever reason. They will eventually pop up when they have something in their inventory. Nothing to worry about, just keep checking and it will eventually pop up.

like image 151
user1132959 Avatar answered Jan 29 '26 05:01

user1132959


I have the same problem. But I think the Google Admob FAQ has the answer https://developers.google.com/mobile-ads-sdk/kb/#whynoads

Quote:

I think I've implemented everything correctly, so why am I not seeing ads?

While maintaining the highest possible fill rate is one of our top priorities, we may not always have an ad available for every ad request. This can be especially common during development, when ad requests are typically made infrequently from a small number of users and devices. When apps are newly registered on AdMob it may also take some time and several requests before impressions are consistently delivered. Developers generally see more consistent results once they have released their app and ad requests arrive more frequently from a more diverse user base.

Note: The very first time AdMob sees your publisher ID it may take up to two minutes to receive an ad, and this initial two minute lag will recur every time the app goes unused for 24 hours.

And yes, the admob reports showing low request count.

like image 39
odys Avatar answered Jan 29 '26 05:01

odys