Null Pointer exception in com.google.android.gms.ads.internal.mediation

1,170 views
Skip to first unread message

Ryan Johnstone

unread,
Sep 7, 2016, 9:20:45 AM9/7/16
to Google Mobile Ads SDK Developers
With no updates to the app we suddenly received a new crash with a high velocity and no idea how to debug, unable to reproduce. 

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
       at java.util.regex.Matcher.appendEvaluated(Matcher.java:131)
       at java.util.regex.Matcher.appendReplacement(Matcher.java:111)
       at java.util.regex.Matcher.replaceAll(Matcher.java:319)
       at java.lang.String.replaceAll(String.java:1353)
       at com.google.android.gms.ads.internal.mediation.k.a(:com.google.android.gms.DynamiteModulesA:75)
       at com.google.android.gms.ads.internal.zzt$zza.b(:com.google.android.gms.DynamiteModulesA:179)
       at com.google.android.gms.ads.internal.reward.mediation.i.run(:com.google.android.gms.DynamiteModulesA:85)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:158)
       at android.app.ActivityThread.main(ActivityThread.java:7229)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)


Ryan Johnstone

unread,
Sep 7, 2016, 9:23:48 AM9/7/16
to Google Mobile Ads SDK Developers
Play services 9.2.1

Vu Chau (Mobile Ads SDK Team)

unread,
Sep 7, 2016, 12:22:43 PM9/7/16
to Google Mobile Ads SDK Developers
Hi Ryan,

Google Play services v9.4.0 shipped with fixes to similar crashes.  I would recompile your app against the latest version to see if there is an improvement.

Feel free to follow up with us,

Vu Chau
Mobile Ads SDK Team

Ryan Johnstone

unread,
Sep 9, 2016, 3:41:12 AM9/9/16
to Google Mobile Ads SDK Developers
Thanks Vu, but we're still experiencing the same crash on 9.4.0

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 9, 2016, 3:52:31 PM9/9/16
to Google Mobile Ads SDK Developers
Hi Ryan,

Can you send us your crash logs and link to your app? Also send us a Charles session of your app would be helpful. Once we receive this, we would be looking into this issue again.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Ryan Johnstone

unread,
Sep 12, 2016, 3:43:33 AM9/12/16
to Google Mobile Ads SDK Developers
Seems to have stopped again now... I'll provide those details if it occurs again, thanks :)

Raimon PlaySpace

unread,
Sep 27, 2016, 3:32:20 AM9/27/16
to Google Mobile Ads SDK Developers
We are experiencing the same crash using Google Play Services 9.4.0.

This is part of our build.gradle:

def playServicesVer = '9.4.0'
compile
("com.google.android.gms:play-services-ads:${playServicesVer}")         { transitive = true }
compile
("com.google.android.gms:play-services-ads-lite:${playServicesVer}")    { transitive = true }
compile
("com.google.android.gms:play-services-analytics:${playServicesVer}")   { transitive = true }
compile
("com.google.android.gms:play-services-appindexing:${playServicesVer}") { transitive = true }
compile
("com.google.android.gms:play-services-auth:${playServicesVer}")        { transitive = true }
compile
("com.google.android.gms:play-services-base:${playServicesVer}")        { transitive = true }
compile
("com.google.android.gms:play-services-basement:${playServicesVer}")    { transitive = true }
compile
("com.google.android.gms:play-services-games:${playServicesVer}")       { transitive = true }
compile
("com.google.android.gms:play-services-gcm:${playServicesVer}")         { transitive = true }
compile
("com.google.android.gms:play-services-identity:${playServicesVer}")    { transitive = true }
compile
("com.google.android.gms:play-services-plus:${playServicesVer}")        { transitive = true }
compile
("com.google.android.gms:play-services-clearcut:${playServicesVer}")    { transitive = true }
compile
("com.google.android.gms:play-services-gass:${playServicesVer}")        { transitive = true }
compile
("com.google.android.gms:play-services-tasks:${playServicesVer}")       { transitive = true }


And this is our crash report:

E/AndroidRuntime(22368)       : FATAL EXCEPTION: main
E
/AndroidRuntime(22368)       : Process: com.xxxx.xxxxxxxxx, PID: 22368
E
/AndroidRuntime(22368)       : java.lang.Error: FATAL EXCEPTION [main]
E
/AndroidRuntime(22368)       : Unity version     : 5.3.6p2
E
/AndroidRuntime(22368)       : Device model      : asus Nexus 7
E
/AndroidRuntime(22368)       : Device fingerprint: google/razor/flo:5.0.2/LRX22G/1649326:user/release-keys
E
/AndroidRuntime(22368)       :  
E
/AndroidRuntime(22368)       : Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
E
/AndroidRuntime(22368)       : at java.util.regex.Matcher.appendEvaluated(Matcher.java:131)
E
/AndroidRuntime(22368)       : at java.util.regex.Matcher.appendReplacement(Matcher.java:111)
E
/AndroidRuntime(22368)       : at java.util.regex.Matcher.replaceAll(Matcher.java:319)
E
/AndroidRuntime(22368)       : at java.lang.String.replaceAll(String.java:1600)
E
/AndroidRuntime(22368)       : at com.google.android.gms.ads.internal.mediation.k.a(:com.google.android.gms.DynamiteModulesA:75)
E
/AndroidRuntime(22368)       : at com.google.android.gms.ads.internal.c.b(:com.google.android.gms.DynamiteModulesA:179)
E
/AndroidRuntime(22368)       : at com.google.android.gms.ads.internal.reward.mediation.i.run(:com.google.android.gms.DynamiteModulesA:85)
E
/AndroidRuntime(22368)       : at android.os.Handler.handleCallback(Handler.java:739)
E
/AndroidRuntime(22368)       : at android.os.Handler.dispatchMessage(Handler.java:95)
E
/AndroidRuntime(22368)       : at android.os.Looper.loop(Looper.java:135)
E
/AndroidRuntime(22368)       : at android.app.ActivityThread.main(ActivityThread.java:5221)
E
/AndroidRuntime(22368)       : at java.lang.reflect.Method.invoke(Native Method)
E
/AndroidRuntime(22368)       : at java.lang.reflect.Method.invoke(Method.java:372)
E
/AndroidRuntime(22368)       : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E
/AndroidRuntime(22368)       : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)


This is a Unity3D game, using Google Play Services, Firebase and AdMob with mediation.

Any suggestion why it might be crashing? Thanks a lot! 

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 27, 2016, 11:45:53 AM9/27/16
to Google Mobile Ads SDK Developers
Hi Raimon,

Thank you for the stack trace. These traces do not look similar to the one reported originally in this thread. Can you send us more details?
  • Charles logs of your app.
  • Code snippets and if you are able to reproduce this locally, then steps to do so.
  • Your Ad Unit IDs.
  • Finally, link to your app and tell us where these crashes might be occurring.
  • Also, can you tell us the local Play Services version?
Thanks,
Arjun Busani
Mobile Ads SDK Team

Raimon PlaySpace

unread,
Oct 4, 2016, 4:25:10 AM10/4/16
to Google Mobile Ads SDK Developers
Hi Arjun,

Thanks for your response. It looks like the bug was in our side, even though it is not evident from the stack trace.

We're trying to figure out what it is, I'll post an update when I have more info.

Thanks a lot!


Raimon
Reply all
Reply to author
Forward
0 new messages