java.lang.NullPointerException: , crash in Android IMA sdk 3.11.2

918 views
Skip to first unread message

Mark S

unread,
Jul 15, 2019, 4:10:48 AM7/15/19
to Interactive Media Ads SDK
Hi,
Since upgrade of the Android IMA SDK 3.11.2, I am getting the crash. (from google play console)
It happens when request ad.

This did not happen with 3.8.5 version of the SDK

Please help, thanks.


Gradle :
com.google.ads.interactivemedia.v3:interactivemedia:3.11.2

Crash Log : 

Android 4.4, 5.0, 5.1, 6.0, 9.0
java.lang.NullPointerException:
  at com.google.ads.interactivemedia.v3.impl.data.y.create (y.java:32)
 at com.google.ads.interactivemedia.v3.internal.aci.onPostExecute (aci.java:30)
 at android.os.AsyncTask.finish (AsyncTask.java:632)
 at android.os.AsyncTask.access$600 (AsyncTask.java:177)
 at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:645)
 at android.os.Handler.dispatchMessage (Handler.java:102)
 at android.os.Looper.loop (Looper.java:146)
 at android.app.ActivityThread.main (ActivityThread.java:5602)
 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:1283)
 at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1099)
 at dalvik.system.NativeStart.main (NativeStart.java)


Android 6.0, 7.0, 7.1, 8.0, 8.1
java.lang.NullPointerException:
  at com.google.ads.interactivemedia.v3.impl.data.y.create (y.java:32)
 at com.google.ads.interactivemedia.v3.internal.aci.onPostExecute (aci.java:30)
 at android.os.AsyncTask.finish (AsyncTask.java:667)
 at android.os.AsyncTask.-wrap1 (AsyncTask.java)
 at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:684)
 at android.os.Handler.dispatchMessage (Handler.java:102)
 at android.os.Looper.loop (Looper.java:163)
 at android.app.ActivityThread.main (ActivityThread.java:6372)
 at java.lang.reflect.Method.invoke (Method.java)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:901)
 at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:791)

Android 5.0~Android 9.0
java.lang.NullPointerException:
  at com.google.ads.interactivemedia.v3.internal.ade.<init> (ade.java:29)
 at com.google.ads.interactivemedia.v3.internal.ade.<init> (ade.java:3)
 at com.google.ads.interactivemedia.v3.internal.aed.<init> (aed.java:11)
 at com.google.ads.interactivemedia.v3.internal.aed.<init> (aed.java:1)
 at com.google.ads.interactivemedia.v3.internal.acl.<init> (acl.java:15)
 at com.google.ads.interactivemedia.v3.internal.acl.<init> (acl.java:1)
 at com.google.ads.interactivemedia.v3.internal.adu.a (adu.java:7)
 at com.google.ads.interactivemedia.v3.internal.aeb.d (aeb.java:141)
 at com.google.ads.interactivemedia.v3.internal.aeb.a (aeb.java:13)
 at com.google.ads.interactivemedia.v3.internal.adz.b (adz.java:42)
 at com.google.ads.interactivemedia.v3.internal.aea.shouldOverrideUrlLoading (aea.java:4)
 at android.webkit.WebViewClient.shouldOverrideUrlLoading (WebViewClient.java:73)
 at aML.a (aML.java:1)
 at uU.a (uU.java:21)
 at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading (AwContentsClientBridge.java:160)
 at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
 at android.os.MessageQueue.next (MessageQueue.java:325)
 at android.os.Looper.loop (Looper.java:145)
 at android.app.ActivityThread.main (ActivityThread.java:6578)
 at java.lang.reflect.Method.invoke (Method.java)
 at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
 at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)






Rewards
Mark.

IMA SDK

unread,
Jul 15, 2019, 6:04:46 AM7/15/19
to lookm...@gmail.com, ima...@googlegroups.com

Hi Mark,

Thank you for reaching out to us and for sharing your concern.

I have tested the IMA SDK for Android basic sample app on an actual device (Google Pixel 3XL/Android 9), and updated the SDK version to 3.11.2. However, I was not able to replicate the issue you have encountered.

With this, could you also test the basic sample app on your end? And let me know if you will encounter the same issue


Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001U8LJnw:ref

孫詩華

unread,
Jul 18, 2019, 6:23:37 AM7/18/19
to Interactive Media Ads SDK
Hi 
I have same problem.
I use custom player to play advertisement media file and AdDisplayContainer will register com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer to receive player event.
I also cannot replicate the issue in my devices, but firebase crash report still receive a lot of crash like below

Fatal log : 
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.ViewGroup.getWidth()' on a null object reference
      at com.google.ads.interactivemedia.v3.impl.data.y.create + 32(y.java:32)
      at com.google.ads.interactivemedia.v3.internal.aci.onPostExecute + 30(aci.java:30)
      at android.os.AsyncTask.finish + 660(AsyncTask.java:660)
      at android.os.AsyncTask.-wrap1(AsyncTask.java)
      at android.os.AsyncTask$InternalHandler.handleMessage + 677(AsyncTask.java:677)
      at android.os.Handler.dispatchMessage + 110(Handler.java:110)
      at android.os.Looper.loop + 208(Looper.java:208)
      at android.app.ActivityThread.main + 6304(ActivityThread.java:6304)
      at java.lang.reflect.Method.invoke(Method.java)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 1063(ZygoteInit.java:1063)
      at com.android.internal.os.ZygoteInit.main + 924(ZygoteInit.java:924)



can you help me explain what is com.google.ads.interactivemedia.v3.impl.data.y.create class?

thank you



imasdkforumadvisor於 2019年7月15日星期一 UTC+8下午6時04分46秒寫道:

IMA SDK

unread,
Jul 18, 2019, 10:46:58 PM7/18/19
to usc.i...@gmail.com, ima...@googlegroups.com

Hi there,


Thank you for reaching out to us.

For us to investigate further, could you provide the complete stack trace of the crash? Also, it will be a great help if you can share with us your test project where the issue is reproducible.

You can share this via "Reply privately to author" option.




Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001U8LJnw:ref

孫詩華

unread,
Jul 29, 2019, 10:12:32 PM7/29/19
to Interactive Media Ads SDK
Hi 
I have send the test project for you, if you are not receive it

please tell me
thank you


imasdkforumadvisor於 2019年7月19日星期五 UTC+8上午10時46分58秒寫道:

IMA SDK

unread,
Jul 30, 2019, 2:12:54 AM7/30/19
to usc.i...@gmail.com, ima...@googlegroups.com

Hi there,

Thank you for your response. I have already responded to you regarding this issue, but it appears to be not posted here on this forum (probably my response has been sent to your private email, kindly check).

However, for your reference, please see below:

Upon testing your test project implementation, I was able to reproduce the issue (Please see attached screenshot: test1).

However, as I've checked the codes, it seems there's an issue, particularly on the destroyAdsManager in ImaSdkHandler.java (Attached screenshot: test2). The AdDisplayContainer is being destroyed in which this should be called when the associated AdsLoader is no longer needed, as per this 
document.

Could you try removing this (Attached screenshot: test3) or call the AdDisplayContainer destroy method after the ad completion? And let me know if you will encounter the same issue.


Let me know if you have further questions or clarification.




Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001U8LJnw:ref

krackjack234

unread,
Jan 17, 2020, 11:47:21 PM1/17/20
to Interactive Media Ads SDK
Hi,

We are getting the same crash in our production app when we use IMA version 3.11.3.

Can you please confirm if the order of destroy mentioned below is correct?


if (mAdsLoader !=null) {
mAdsLoader.removeAdErrorListener(this);
mAdsLoader.removeAdsLoadedListener(this);
mAdsLoader = null;
}

if (adDisplayContainer != null)
adDisplayContainer.destroy();
if (mAdsManager != null) {
mAdsManager.removeAdErrorListener(this);
mAdsManager.removeAdEventListener(this);
mAdsManager.destroy();
}

Thanks in advance.

IMA SDK

unread,
Jan 20, 2020, 12:59:03 AM1/20/20
to biswa...@gmail.com, ima...@googlegroups.com

Hi there,

 

Thank you for reaching out to us. With regard to the crash issue that you are facing, would you be able to update your IMA SDK to version 3.13.1, and see if you will encounter the same behavior?

 

Regards,

Sherwin Diesta

IMA SDK Team



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