Search code examples
androidadmobvungle-adsmobile-ad-mediation

Null Pointer Exception when showing Vungle ads with Admob Mediation


I have integrated Vungle to display a rewarded video ads using Admob as the mediator. On my phone the ads load and play just fine, including when the screen is forced to rotate for the ads orientation. But for a large percentage of users I am seeing this crash below. I am unsure if they are crashing when I first show the ad, or after the ad completes and its coming back to my Activity.

The Admob code was setup per their documentation. I also followed the Vungle documentation as well as making sure to add the required ProGuard configuration.

The crash to me looks like some sort of crash inside of the GoogleApiActivity and my best guess is its related to connecting to google services but given the nature of the code being obfuscated I can't tell whats going wrong.

I am not sure if its possibly related but I am also using the (very new) firebase ads library so maybe thats still really buggy?

At this point I am wondering if its the Admob mediation thats the source of the bugs. I don't expect that Vungle would be relying on a GoogleApiActivity. It could also be a bug with the new Firebase as well. Does anyone have any ideas what the cause of this may actually be?

Related libraries that are included in the project are:

  • compile 'com.google.android.gms:play-services-gcm:9.0.0'
  • 
compile 'com.google.android.gms:play-services-analytics:9.0.0'
  • compile 'com.google.android.gms:play-services-ads:9.0.0'
  • compile 'com.google.android.gms:play-services-location:9.0.0'
  • compile "com.google.firebase:firebase-ads:9.0.0"

StackTrace

Caused by java.lang.NullPointerException
       at com.google.android.gms.common.api.GoogleApiActivity.zza(Unknown Source)
       at com.google.android.gms.common.api.GoogleApiActivity.onActivityResult(Unknown Source)
       at android.app.Activity.dispatchActivityResult(Activity.java:5634)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:3637)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3043)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3085)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2498)
       at android.app.ActivityThread.access$800(ActivityThread.java:166)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5584)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
       at dalvik.system.NativeStart.main(NativeStart.java)

Solution

  • Vungle Android SDK doesn't support Google-Play_services 9.x yet. Can you try to use GMS version 8.x instead?

    Is that possible for your project?

    Thanks, -aki