Crash in Mediation Test Suite when account has a legacy banner+interstitial ad unit

76 views
Skip to first unread message

Michael Grundberg

unread,
Jul 21, 2020, 9:59:44 AM7/21/20
to Google Mobile Ads SDK Developers
Hi,

When launching Mediation Test Suite by executing

MediationTestSuite.launch(getActivity());

The app crashes on a NPE:

    java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.add(java.lang.Object)' on a null object reference
        at com.google.android.ads.mediationtestsuite.dataobjects.ConfigurationItem.<init>(ConfigurationItem.java:68)
        at com.google.android.ads.mediationtestsuite.dataobjects.AdUnit.<init>(AdUnit.java:63)
        at com.google.android.ads.mediationtestsuite.utils.MediationConfigClient.getAdUnitsFromCldJson(MediationConfigClient.java:146)
        at com.google.android.ads.mediationtestsuite.utils.MediationConfigClient$1.onResponse(MediationConfigClient.java:110)
        at com.google.android.ads.mediationtestsuite.utils.MediationConfigClient$1.onResponse(MediationConfigClient.java:106)
        at com.android.volley.toolbox.JsonRequest.deliverResponse(JsonRequest.java:90)
        at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:102)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

I stepped into the decompiled .class which reveals that the crash happens when format parameter to ConfigurationItem constructor is AdFormat.BANNER_INTERSTITIAL. This causes ((List)this.configsPerFormat.get(format)) to return null.

Best regards,
Michael Grundberg

Michael Grundberg

unread,
Jul 21, 2020, 10:01:31 AM7/21/20
to Google Mobile Ads SDK Developers
Forgot to mention that the crash happens while using com.google.android.ads:mediation-test-suite:1.3.0 and com.google.android.gms:play-services-ads:19.3.0.

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 21, 2020, 2:06:41 PM7/21/20
to michaelg...@gmail.com, google-adm...@googlegroups.com
Hi Michael,

Thank you for bringing this issue to our attention.

Having read over the stacktrace that you showed us. I see that you are getting the NullPointerException that appears to be causing the issue.We would nee to get some more information so that we can look at this a little deeper.

Also just interested in knowing if the JSON request could have had any impact on the list that is being called ? As I am wondering if that could have not filled the required List thus leaving it as empty? Also is it possible to see the step through of the decompiled class. You say you are using a legacy Ad Unit Id and App Id? How old are they?

If you can share with us via "Reply privately to author" button with the following information.
  • App Id and Ad Unit Id in question
  • A sample app if possible that illustrates this issue.
  • Any Charles logs or stacktraces that also show what is happening.
  • Have you also checked out our Mediation Test Suite Documentation .
  • Steps to reproduce the issue if any.
  • Devices or OS versions that you might see this happening on.
Regards,
William Pescherine
Mobile Ads SDK Team

ref:_00D1U1174p._5004Q22XrTt:ref

Michael Grundberg

unread,
Jul 21, 2020, 3:05:52 PM7/21/20
to Google Mobile Ads SDK Developers
Thanks for the reply! I'm posting here for the sake of the community.

The app in question has been on Play for almost a decade, and is still using the original ad unit from back then. I've recently added other ad units that will be using mediation, which was what I was trying to test.

The reason I suspect this particular Ad Unit is because the crash occurs when the code calls com.google.android.ads.mediationtestsuite.dataobjects.AdUnit.<init> for that legacy ad unit.

I've seen the crash both on simulator using API 29 and on my Pixel 3 device that uses latest Android 10.

I'll be sending further sensitive details via private reply.
Reply all
Reply to author
Forward
0 new messages