After adding new Google Ads SDK with adaptive banner crash rate of app is high.

87 views
Skip to first unread message

Gokhan UNLU

unread,
Oct 29, 2021, 6:38:29 PM10/29/21
to Google Mobile Ads SDK Developers
Hello.

I am using admob adaptive banner in my application.

but ; The getAdSize function in the directives constantly crashes.

"Fatal Exception: java.lang.IllegalArgumentException 
pointerIndex out of range pointerIndex=-1 pointerCount=1
android.view.MotionEvent.nativeGetAxisValue
keyboard_arrow_down "

in working fragment. 

AdSize getAdSize() {
        Display display = getActivity().getWindowManager().getDefaultDisplay();
        DisplayMetrics outMetrics = new DisplayMetrics();
        display.getMetrics(outMetrics);

        float density = outMetrics.density;

        float adWidthPixels = adContainerView.getWidth();

        if (adWidthPixels == 0) {
            adWidthPixels = outMetrics.widthPixels;
        }

        int adWidth = (int) (adWidthPixels / density);
        return AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(getActivity(), adWidth);
    }

AdView adView = new AdView(getActivity());
AdSize adSize = getAdSize();
adView.setAdSize(adSize);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);

Where do you think I am doing wrong?

Ekran Resmi 2021-10-30 01.34.40.png
Ekran Resmi 2021-10-30 01.35.16.png

Ekran Resmi 2021-10-30 01.35.56.png

Mobile Ads SDK Forum Advisor

unread,
Nov 1, 2021, 11:00:02 AM11/1/21
to unlugo...@gmail.com, google-adm...@googlegroups.com
Hi Gokhan,

Thank you for reaching out to us with your concern. In looking over this we would ask if you can share with us via the "Reply to author" button with a simple sample of your app. Along with any steps that help us to replicate this crash. Also we ask if you have tested this out with one of our samples .

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2QGWO7:ref
Reply all
Reply to author
Forward
0 new messages