AdView with AdMob not Visible on Mobile Device

47 views
Skip to first unread message

Tobias Semmet

unread,
May 18, 2018, 8:42:56 AM5/18/18
to Google Mobile Ads SDK Developers
Hello,

i've created a AdMob Account and have added my App. I got the my App-ID : ca-app-pub-5XXX84XXX4919XXX~XXX2987XXX ( I changed some numbers to 'X').

Than I create a Bannerview with the ID : ca-app-pub-5XXX84XXX4919XXX/XXX6405XXX ( I changed some numbers to 'X').

My Code :

final AdView adView = new AdView(appHandler.getActivity());

        adView.setAdSize(AdSize.BANNER);


        final AdRequest adRequest = new AdRequest.Builder().build();

        if (adRequest.isTestDevice(appHandler.getActivity())) {

            // Test Device (Android Studio)

            if (appHandler.getAdMobileId()==null) {

                // No MobileAd Initialization

               // Initial the MobileAd with the Test-Id

                MobileAds.initialize(appHandler.getActivity(), "ca-app-pub-3940256099942544~3347511713");
                appHandler.setAdMobileId("ca-app-pub-3940256099942544~3347511713");
            }

           // Set the Test AdUnitId to the adView

            adView.setAdUnitId("ca-app-pub-3940256099942544/6300978111");
        } else {

            // Productive Device

            if (appHandler.getAdMobileId()==null) {

                // No MobileAd Initialization

               // Initial the MobileAd App-Id

                MobileAds.initialize(appHandler.getActivity(), "ca-app-pub-5XXX84XXX4919XXX~XXX2987XXX");
                appHandler.setAdMobileId("ca-app-pub-5XXX84XXX4919XXX~XXX2987XXX");
            }

           // Set the BannerView AdUnitId to the adView

            adView.setAdUnitId("ca-app-pub-5XXX84XXX4919XXX/XXX6405XXX");

        }

        // Add the adRequest to the adView

        adView.loadAd(adRequest);

        // Add the View to the GridLayout

        innerGrid.addView(adView);

On the Android Studio everything is fine i got the Banner with the "Test Ad" Icon.
On some older Produktiv Devices the Banner is shown ok.
On some newer Devices ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) the banner is not shown with the ErrorCode '1' --> AdRequest.ERROR_CODE_INVALID_REQUEST

I don't know what i am doing wrong.

Is there any Idea ?

Thanks.

Tobias

mobileadssdk-a...@google.com

unread,
May 18, 2018, 3:34:12 PM5/18/18
to Tobias Semmet, Google Mobile Ads SDK Developers
Hi Tobias,

Thanks for reaching out to us. Can you confirm the device and Android version that you are trying to run on? It might be a device specific issue. In any case, make sure that you are using the latest version of the SDK and try with our sample apps and let us know. If you are still unable to load, then send us - device logs and Charles logs and we will debug this further.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/570ab6fa-561e-4df5-a583-746bb281b9a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mobileadssdk-a...@google.com

unread,
May 22, 2018, 3:19:37 PM5/22/18
to Tobias Semmet, Google Mobile Ads SDK Developers
Hi Tobias,

Thanks for adding the additional information. Can you send us the device logs, SDK version, Android version and Charles logs for us to debug this issue? If you are able to load test ads, then the integration is not the issue. Can you also try to reproduce this via our sample app and let us know if this is still occurring?

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages