[SDKBOX] AdMob doesn't load ads on Android

Hi guys! :slight_smile:

I need some help with SDKBOX AdMob plugin.
I integrated the AdMob plugin in my project and all worked well for a while (iOS and Android).
Suddenly however the Ads stopped to work on my Android Device.
For not working well I mean:

  • Rewarded video ads doesn’t appear
  • Interstitial Ads appears but with empty content (basically a black screen).

On the init I get:

I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("XXXXXXXXXXXXXX") to get test ads on this device.
I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("XXXXXXXXXXXXXX") to get test ads on this device.
W/Ads: Server parameters: {"gwhirl_share_location":"1","pubid":"ca-app-pub-1204161248219313\/6382217983\/cak=no_cache&cadc=ws&caqid=wakWWdvlNt7bxgK4ub-QAg"}
W/Ads: Server parameters: {"gwhirl_share_location":"1","pubid":"ca-app-pub-1204161248219313\/6382217983\/cak=no_cache&cadc=ws&caqid=wakWWdvlNt7bxgK4ub-QAg"}
I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice(""XXXXXXXXXXXXXX") to get test ads on this device.
I/Ads: Ad finished loading.
W/Ads: Failed to load ad: 0
W/Ads: Failed to load ad: 3

I’m not using AdMob in test mode because it seems does not support rewarded video.
I tried different campaign id, but the problem is the same.
No problem on iOS side!

Here some information about my configuration:

  • Cocos2d-x 3.15
  • SDKBOX v1.0.1.22
  • v2.3.13.5 admob
  • v2.3.13.5 googleplayservices
  • Device: Galaxy S3 (Android 4.3)
  • Android Studio 2.3.2

Any suggestion?
Thanks

you can check the admob status https://apps.admob.com

one thing, using test mode when you testing ad. Otherwise, google will close your admob account.

Hi @yinjimmy, thanks for your answer. :slight_smile:
On my AdMob page all looks good, I don’t see strange things.
The thing is that I tried different Ad ID (even the ones in the SDKBOX AdMob samples).
Then I’m not sure the issue is related with my AdMob account.
I agree with using the test mode during development, but there is the problem of testing the rewarded video Ads (they don’t work in test mode)!

This may be a long shot, I don’t think this is the error I was getting, but are you using the is_designed_for_families flag? If yes try removing it or setting it to false. Having this on wasn’t loading any ads on Android for me. I ended up disabling certain ad categories in Admob directly instead of using this flag.

1 Like

Hi @clearmend
Where can I check if the is_designed_for_families is enabled?

It’ll be in your sdkbox_config.json, as seen here: http://docs.sdkbox.com/en/plugins/admob/v3-cpp/

@clearmend sadly I don’t have is_designed_for_families in my sdkbox_config.json file… :neutral_face:

Then it’s disabled by default.

@nite, @yinjimmy
The issue seems not related to my project or my AdMob account:
I did this to reproduce:

cocos new -l cpp AdmobTest
sdkbox import admob

Modify the template project in this way:

AppDelegate.cpp

bool AppDelegate::applicationDidFinishLaunching() {
#ifdef SDKBOX_ENABLED
    sdkbox::PluginAdMob::init();
    sdkbox::PluginAdMob::cache("gameover");
    sdkbox::PluginAdMob::cache("rewarded_video");
#endif
....
}

HelloWorldScene.cpp

void HelloWorld::menuCloseCallback(Ref* pSender) {
    sdkbox::PluginAdMob::show("gameover");
}

In the output ad init time I get:

W/Ads: Failed to load ad: 0
W/Ads: Failed to load ad: 3

And when I click on the button I get a completely white screen (basically an empty ad).
I didn’t change the template sdkbox_config.json.

On stackoverflow someone says this is related with the server that does not have ads to provide to the client.
But why? And why this happens with different Admob apps and Ad units?

Admob have a limited amount of ads for an app/game to show, sometimes they don’t have any ads left for your app.

However, if you turn on test mode, should should always getting testing ads.

2 Likes

@nite
I tried also to create a fresh app in AdMob to make further tests. No way!
My app is not in production, therefore a tiny number of ads are requested each day!
On iOS with a very similar situation Interstitial ads always work!
Yes, in test mode there aren’t problem, but rewarded videos don’t work in this mode.

edit your sdkbox_config.json:

{
    "android": {
        "AdMob": {
            "test": true,  # test mode, then you'll get the test ad

just tested with cpp 3.8.1 + PluginAdMob 2.3.13.5 .

works and sometimes not when "test":false.

2 Likes

@yinjimmy
You re right, sometimes the issue happens in test mode also.
However in test mode I never saw a white empty Ad, the interstitial test ad is properly visualised.
Do you think the issue is inside SDKBOX or server side on Google?

Thanks for your support.

1 Like

by google, i think.

Hi

I have found an issue with SDKBOX not showing ads when they are cached in a certain way. I will put a post up ‘AdMob Android Caching Issue’.

Cheers

@zx12a1 I read your post.
I have the issue at init time and not when I cache multiple ads.
Maybe the init do this internally…

@drakon99

thanks, so where do you do the caching if not in init()?

you can cache the ads again when there’s error.

You don’t need to do caching in:
bool AppDelegate::applicationDidFinishLaunching()
You can cache when a particular Layer is loaded for example (this is what I do).

However this can easily create a loop: cache -> error -> cache -> error …