Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Admob banner and interstitial ads not loading on launcher activity

Tags:

android

admob

The first time when I load my app the banner ad and the full screen interstitial ad does not load. Every other time when i hit that (or any other) Activity the ads load fine. This leads me to believe that its not a fill issue. Also i am not using any mediation, just the standard Admob network.

Below is the code i use to load the banner ad

AdView bannerAdView = (AdView)this.findViewById(R.id.adView);
    if (Settings.SHOW_ADS) {
        AdRequest adRequestBanner = new AdRequest.Builder().build();
        bannerAdView.loadAd(adRequestBanner);
    }

Log cat reports back the following error

10-11 21:33:51.749  19409-19439/ W/Ads﹕ There was a problem getting an ad response. ErrorCode: 0
10-11 21:33:51.839  19409-19409/ W/Ads﹕ Failed to load ad: 0
10-11 21:33:47.039  19409-19409/ E/Ads﹕ JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (:1)

Is there anything i can do to make the ad load close to 100% of the time, especially the full screen ad?

like image 680
Parampal Pooni Avatar asked Oct 11 '14 10:10

Parampal Pooni


3 Answers

Also Your package might be blocked by Google AdMob. If you received a email like this:

Hello,

This email is to alert you that one of your applications is not currently in compliance with our AdMob program policies and as a result, ad serving has been disabled to your application.

Issue ID#: 33943***

Ad serving has been disabled to: APPNAME (com.example.pack)

Action required: Check all other remaining applications in your account for compliance.

Current account status: Active

Violation explanation

GOOGLE PLAY REMOVAL: AdMob publishers are not permitted to abuse or promote the abuse of any Google product, such as Google Play, YouTube, or Blogger. This includes circumventing, or providing the means to circumvent, the policies or terms of these or other Google products, such as by allowing users to download YouTube videos.

If your app is removed by Google Play policy enforcement, please contact Google Play about an app removal here. If Google Play reinstates your app, please submit an appeal to our team.

Action required: Check account for compliance

While ad serving has been disabled to the above app, your AdMob account remains active. We suggest that you take the time to review the rest of your applications to ensure that they’re in compliance with our policies, and to monitor your apps accordingly to reduce the likelihood of future policy emails from us. Additionally, please note that our team reserves the right to disable accounts at any time if we continue to see violations occurring.

Appeals

If you wish to appeal this disabling then you can do so by using our appeal form.

Thank you for your cooperation.

Sincerely,

The Google AdMob Team

So now you need to change your package of your app. on eclipse it is package="com.example" in AndroidManifest.xml file

or

on AndroidStudio applicationId "com.example" in build.gradle file

like image 150
NickUnuchek Avatar answered Sep 21 '22 17:09

NickUnuchek


My best guess is that your Activity loads faster than the Ad. So the Ad isn't ready by the time your activity loads and so the ad doesn't show. Here is a screenshot of my LogCat showing you the different steps the Ad takes to get ready. enter image description here

Also, if the Ad is showing and another Activity (Activity B) is called, then Activity B will override the Ad. You can see that the Ad is still on the stack by pushing the back button on your phone/emulator. Pushing that button should return u back to the Ad.

like image 45
Gene Avatar answered Sep 22 '22 17:09

Gene


This issue has disappeared when upgrading to the latest google play services lib in my Gradle file.

At the time of writing this, the latest version is 6.1.71 and the dependancy looks like this:

compile 'com.google.android.gms:play-services:6.1.71'
like image 45
Parampal Pooni Avatar answered Sep 21 '22 17:09

Parampal Pooni