Admob ads not showing in real device

7,229 views
Skip to first unread message

Umashankar B

unread,
Feb 6, 2017, 11:14:33 PM2/6/17
to Google Mobile Ads SDK Developers
I am using admob ads for my app. I have taken default activity as admob activity from android studio and then I have changed adunit id. When I have run in emulator, It was showing ad but while I was running same code in real device It was not showing anything, a blank screen was appearing. I am using samsung J7 and samsung duos to run apk. There was nothing showing, I searched different ways but cannot findout what was the wrong.

Ivan Bautista (Mobile Ads SDK Team)

unread,
Feb 7, 2017, 12:06:28 AM2/7/17
to Google Mobile Ads SDK Developers
Hello there,

Please do note that it will take some time before newly created Ad Unit ID/s will start serving live ads. Having said that, can you test your Ad Unit ID/s in question to one of our sample apps and see if you can load ads? 

If issue still persists after testing in our sample apps, then, can you provide us the following so we can investigate further:
  • Complete error logs (Try capturing relevant logs by listening to Ad Events)
  • Ad Unit ID/s in question
  • Sample code of your implementation
  • Logs from Charles' Proxy with SSL Proxying Enabled
Thanks,
Ivan Bautista
Mobile Ads SDK Team
Message has been deleted

Sajan Sahadevan

unread,
Feb 8, 2017, 12:30:25 AM2/8/17
to Google Mobile Ads SDK Developers
Hello Ivan,

I am also facing the same issue. Its working locally but after uploaded into play store, its showing blank space. Please help.

This is my Ad Unit ID : 
Format: Banner
ID: ca-app-pub-6858314599865339/8531345006

Ivan Bautista (Mobile Ads SDK Team)

unread,
Feb 8, 2017, 1:00:55 AM2/8/17
to Google Mobile Ads SDK Developers
Hi Sajan,

I tested your Ad Unit ID with our sample app and was able to load ads. As I mentioned in an earlier response, to investigate more effectively, can you provide us the following:
    • Complete error logs (Try capturing relevant logs by listening to Ad Events)
    • Sample code of your implementation
    • Logs from Charles' Proxy with SSL Proxying Enabled
    Thanks,
    Ivan Bautista
    Mobile Ads SDK Team

    Sajan Sahadevan

    unread,
    Feb 8, 2017, 1:51:57 AM2/8/17
    to Google Mobile Ads SDK Developers
    Hi Ivan,

    Following is the log and sample code. Please check

    Log 

    I/Ads: Starting ad request.
    I/Ads: Use AdRequest.Builder.addTestDevice("EB89DD8BA5224613CE4AD2379EC95B53") to get test ads on this device.
     I/cr_Ime: ImeThread is enabled.
    I/Ads: Scheduling ad refresh 60000 milliseconds from now.
    I/Ads: Ad finished loading.
    I/Ads: Ad is not visible. Not refreshing ad.
    I/Ads: Scheduling ad refresh 60000 milliseconds from now.
    I/Ads: Starting ad request.
    I/Ads: Use AdRequest.Builder.addTestDevice("EB89DD8BA5224613CE4AD2379EC95B53") to get test ads on this device.


    Sample Code

    private void setupAds() {
            try {
                AdView adView = new AdView(this);
                adView.setAdUnitId(getResources().getString(
                        R.string.admobpublisher_id));
                adView.setAdSize(AdSize.SMART_BANNER);
                ad_banner.addView(adView);
                AdRequest adRequest = new AdRequest.Builder().build();
                adView.loadAd(adRequest);
            } catch (Exception e) {

                e.printStackTrace();
            }

        }

    Where ad_banner is Linear layout

    Ivan Bautista (Mobile Ads SDK Team)

    unread,
    Feb 8, 2017, 3:58:03 AM2/8/17
    to Google Mobile Ads SDK Developers
    Hi Sajan,

    Can you verify on your end if you are able to load ads using our sample app? Can you also provide us the layout that contains the ad_banner linear layout or a miniature sample app that could reproduce the "Ad is not visible" logs so we can investigate further?

    Thanks, 
    Ivan Bautista 
    Mobile Ads SDK Team

    Sajan Sahadevan

    unread,
    Feb 8, 2017, 6:23:29 AM2/8/17
    to Google Mobile Ads SDK Developers
    Hi Ivan,

    I am not able to load ads using the sample app. Please check the following log and ad_banner layout. I am having this issue with some devices only. Its working on Samsung S6. This is from Asus 5.5 inch screen.

    02-08 16:45:06.440 23725-23725/com.google.android.gms.example.bannerexample D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
    02-08 16:45:07.099 23725-23725/com.google.android.gms.example.bannerexample I/Ads: Starting ad request.
    02-08 16:45:07.101 23725-23725/com.google.android.gms.example.bannerexample I/Ads: Use AdRequest.Builder.addTestDevice("09A28F0B0B060619791FE9B9A18E71C7") to get test ads on this device.
    02-08 16:45:08.928 23725-23742/com.google.android.gms.example.bannerexample W/Ads: There was a problem getting an ad response. ErrorCode: 2
    02-08 16:45:08.930 23725-23725/com.google.android.gms.example.bannerexample I/Ads: Scheduling ad refresh 60000 milliseconds from now.
    02-08 16:45:08.931 23725-23725/com.google.android.gms.example.bannerexample W/Ads: Failed to load ad: 2


    <LinearLayout
                android:id="@+id/ad_banner"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:layout_alignParentBottom="true"
                android:background="@android:color/darker_gray"
                >

            </LinearLayout> 

    Ivan Bautista (Mobile Ads SDK Team)

    unread,
    Feb 8, 2017, 10:53:26 PM2/8/17
    to Google Mobile Ads SDK Developers
    Hi Sajan,

    The Error Code: 2 you encountered in some devices while loading ads using the sample app could be cause by some network connectivity issue. Can you try connecting to a more stable network and see if problem persists with the sample app? Also, make sure that you don't have any ad blockers installed/enabled in the device where you are getting the error.

    In addition, does the ad_banner layout has a parent layout or it's the main parent layout of the XML layout file? Also, is there a specific reason why you need to create an ad_banner linear layout to contain the AdView instead of directly adding the AdView to the main parent layout?


    Thanks, 
    Ivan Bautista 
    Mobile Ads SDK Team

    Sajan Sahadevan

    unread,
    Feb 9, 2017, 4:36:23 AM2/9/17
    to Google Mobile Ads SDK Developers
    Hi Ivan,

    This is the latest log from the device. We have changed the layout also. I am using a 4g network.

    01:13.301 15948-15948/? D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
    02-09 15:01:13.307 15948-15948/? I/Ads: Starting ad request.
    02-09 15:01:13.308 15948-15948/? I/Ads: Use AdRequest.Builder.addTestDevice("09A28F0B0B060619791FE9B9A18E71C7") to get test ads on this device.
    02-09 15:01:13.563 7965-7965/? I/Ads: Received log message: <Google:HTML> You are using version 8.5 of the Google Play services Ads SDK. Please consider updating your SDK to the most recent SDK version to get the latest features and bug fixes. See http://goo.gl/r2TRzC for instructions on how to get the latest version of Google Play services.
    02-09 15:01:13.607 7965-17570/? W/Ads: Error while connecting to ad server: failed to connect to googleads.g.doubleclick.net/216.58.220.2 (port 443) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
    02-09 15:01:13.608 15948-15964/? W/Ads: There was a problem getting an ad response. ErrorCode: 2
    02-09 15:01:13.614 15948-15948/? I/Ads: Scheduling ad refresh 60000 milliseconds from now.
    02-09 15:01:13.614 15948-15948/? W/Ads: Failed to load ad: 2

    Ivan Bautista (Mobile Ads SDK Team)

    unread,
    Feb 9, 2017, 5:48:24 AM2/9/17
    to Google Mobile Ads SDK Developers
    Hi Sajan,

    This might be a device and/or network specific issue because I was able to load ads using your Ad Unit ID on our end. Can you verify if there are any custom ROMs or Ad blockers installed in your device that could have caused the "Connection refused" error? Can you also update your Play Services SDK to the latest version?

    Thanks,
    Ivan Bautista
    Mobile Ads SDK Team

    Sajan Sahadevan

    unread,
    Feb 10, 2017, 4:20:47 AM2/10/17
    to google-adm...@googlegroups.com
    Hi Ivan,

    Solved the issue. It was a network related problem. Thank you so much for the help.

    --

    ---
    You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/2XgBrQsN1MY/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
    To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.



    --
    Thanks & Regards

    Sajan

    Senior QA Engineer
    Rain Concert Technologies (P) Ltd.

    ------------------------------------
    NOTICE:
    This email and any files transmitted with it are confidential. If you have received this email in error please notify the sender and then delete it immediately. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Rain Concert. The recipient should check this email and any attachments for the presence of viruses. Rain Concert accepts no liability for any damage caused by any virus transmitted by this email. Rain Concert may regularly and randomly monitor outgoing and incoming emails (including the content of them) and other telecommunications on its email and telecommunications systems. By replying to this email you give your consent to such monitoring.

    tghat...@gmail.com

    unread,
    Jan 6, 2018, 1:46:48 AM1/6/18
    to Google Mobile Ads SDK Developers


    On Tuesday, February 7, 2017 at 9:44:33 AM UTC+5:30, Umashankar B wrote:
    I am using admob ads for my app. I have taken default activity as admob activity from android studio and then I have changed adunit id. When I have run in emulator, It was showing ad but while I was running same code in real device It was not showing anything, a blank screen was appearing. I am using moto g3 and lenovo note 3 to run apk. There was nothing to showing, I searched different ways but cannot findout what was the wrong.i was spend 3 days 

    Ivan Bautista (Mobile Ads SDK Team)

    unread,
    Jan 7, 2018, 11:26:34 PM1/7/18
    to Google Mobile Ads SDK Developers
    Hi,

    Are you having issues display live ads in your actual Android device but have no issues displaying test ads in an Android emulator using the same code? If so, then it's safe to assume that your code implementation is correct since you were able to display test ads.

    However, being that this is a very old thread, I suggest that you create a new thread in the Google Mobile Ads SDK forum with more details about your concern and from there we could continue with the investigation.

    Regards,

    anupatel...@gmail.com

    unread,
    Feb 23, 2018, 5:32:27 AM2/23/18
    to Google Mobile Ads SDK Developers
    i run test ad in mobile device but it cannot show 

    Ivan Bautista (Mobile Ads SDK Team)

    unread,
    Feb 25, 2018, 10:41:13 PM2/25/18
    to Google Mobile Ads SDK Developers
    Hi,

    Did you went through this guide for displaying test ads using our sample Ad Unit Ids or via an enabled test device? What Ad format are you specifically trying to display/show? 

    However, given that this is an old thread, I suggest that you create a new thread with more details (e.g. device logs including Ad event logs) about your concern and from there we could continue with the investigation.

    hcmut...@gmail.com

    unread,
    Feb 27, 2018, 5:08:23 AM2/27/18
    to Google Mobile Ads SDK Developers
    Hi Ivan,

    I did step by step on https://developers.google.com/admob/unity/start, but the banner does not show on my android mobile as test device.

    When I tried to test on editor unity, I saw message Dummy ...

    Could u please help me to resolve this problem.

    You can see my script attached to 1 game object in this email.

    Thanks
    ShowAdsmanager.txt
    Message has been deleted

    Asif Mahe

    unread,
    Jan 4, 2019, 1:58:29 AM1/4/19
    to Google Mobile Ads SDK Developers
    hi ivan , im also facing same problem, please help me

    mobileadssdk-a...@google.com

    unread,
    Jan 4, 2019, 4:01:00 AM1/4/19
    to Asif Mahe, Google Mobile Ads SDK Developers
    Hi Asif,

    There are a number of factors that could affect Ad serving on your end.

    However, given that this is an old thread, could you create a new thread and provide to us the following information so we can investigate further?
    • Error Code encountered on your end
    • Could you test your Ad Unit Id/s with our sample apps and see if you are able to load ads?
    • Your Ad Unit Id/s in question (Please share this via Reply privately to author option)
    Regards,
    Ivan Bautista
    Mobile Ads SDK Team


    --

    ---
    You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

    To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
    Reply all
    Reply to author
    Forward
    0 new messages