IMA shouldOverrideUrlLoading NPEs
See original GitHub issueIssue description
We are seeing a lot of NullPointerException’s in Firebase coming from IMA in our latest release, containing ExoPlayer 2.12.0 and IMA 3.21.4 (Note: ExoPlayer specifies 3.21.0, so we’ve bumped it slightly).
GIven it’s IMA and obfuscated it’s hard to work out exactly what is going wrong from our perspective. It seems like at some point the WebView is triggering a URL load, which is causing IMA to call into components it thinks should not be null, but are at that point.
I’m guessing it’s some kind of lifecycle thing, maybe ExoPlayer has detached when this event occurs or hasn’t attached yet. Hoping someone who has worked with the IMA code could shed some light / point me in the right direction.
Reproduction steps
I have been so far unable to reproduce this, or find a specific flow making it happen.
Link to test content
Not content specific.
Stacktraces
Note, the actual crashes have repeats of this due to the way WebViews are implemented across devices.
Crash 1
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object com.google.ads.interactivemedia.v3.api.StreamRequest.getUserRequestContext()' on a null object reference
at com.google.ads.interactivemedia.v3.internal.amr.c(IMASDK:3)
at com.google.ads.interactivemedia.v3.internal.aog.d(IMASDK:66)
at com.google.ads.interactivemedia.v3.internal.aom.d(IMASDK:5)
at com.google.ads.interactivemedia.v3.internal.aoj.shouldOverrideUrlLoading(IMASDK:2)
at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:77)
at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-Monochrome.aab-stable-428010123:17)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Crash 2
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.ads.interactivemedia.v3.internal.and.g()' on a null object reference
at com.google.ads.interactivemedia.v3.internal.amr.a(IMASDK:2)
at com.google.ads.interactivemedia.v3.internal.aog.d(IMASDK:71)
at com.google.ads.interactivemedia.v3.internal.aom.d(IMASDK:5)
at com.google.ads.interactivemedia.v3.internal.aoj.shouldOverrideUrlLoading(IMASDK:2)
at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:77)
at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-Monochrome.aab-stable-428014120:17)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:183)
at android.app.ActivityThread.main(ActivityThread.java:7258)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Version of ExoPlayer being used
2.12.0 with IMA 3.21.4
Device(s) and version(s) of Android being used
Device and OS independent
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (12 by maintainers)
Top GitHub Comments
A fix has been submitted for this. I’ll look out for the next IMA SDK update and hopefully we can get that into the next minor release.
@fpitters looks like IMA SDK team has release a fix for the NPE crash https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/history We will try to see if it’s fixes our issue in production which is identical to your report.