Search code examples
androidlibgdxadsenseadmob

Ads are not displaying after publishing final application


I had a game which I designed using libgdx.

It was displaying ads before publishing it on Google Play as I tested it by this code:

adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(AD_UNIT_ID);
AdRequest adRequest = new AdRequest.Builder().addTestDevice(TEST_DEVICE).build();
adView.loadAd(adRequest);

Before publishing the game I changed some lines of my code to be like this:

adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(AD_UNIT_ID);
AdRequest.Builder builder = new AdRequest.Builder();
adView.loadAd(builder.build());

but it shows no ads now.

Is there a problem in my code or it may be in my admob or adsense accounts which I have recently made for the first time ?


Solution

  • Test Ad working fine but not getting live Ads.

    Follow these steps :

    1. Wait for some times/hours.

    2. If you're able to load test ads but not live ads, It sounds like an issue with your AdMob account.

    3. After waiting still having problem then you need to cross check Ad unit Id and AppId from AdMob account.

    4. Make sure that you properly set up a payment system and/or verified your PIN? If they are not done, then live ads would not be served from your account.
    5. Still problem now you need to post your problem in this group for assistance.