java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.ad

3,190 views
Skip to first unread message

Pawan Chaurasiya

unread,
Jun 18, 2019, 10:35:56 PM6/18/19
to Google Mobile Ads SDK Developers
Unity 2019.3.0a2 Personal 
Admob Plugin GoogleMobileAds-v3.17.0
Test Device Android 7.1 


When set adsize to AdSize.SmartBanner getting this exception if change to AdSize.Banner working fine.


AndroidRuntime: FATAL EXCEPTION: main
    Process: com.lazypandastudio.archerysaga, PID: 15981
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.ads.AdSize.isFluid()' on a null object reference
        at com.google.android.gms.internal.ads.zzyb.<init>(Unknown Source)
        at com.google.android.gms.internal.ads.zzaaz.zza(Unknown Source)
        at com.google.android.gms.internal.ads.zzaaz.zza(Unknown Source)
        at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
        at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
        at com.google.unity.ads.Banner$5.run(Banner.java:278)
        at android.os.Handler.handleCallback(Handler.java:754)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:165)
        at android.app.ActivityThread.main(ActivityThread.java:6375)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 18, 2019, 11:45:33 PM6/18/19
to thepaw...@gmail.com, google-adm...@googlegroups.com
Hi Pawan,

Thank you for reaching out to us.

I tried replicating your case on my end, but could not get the sample project to produce the same kind of error. That said, could you send a copy of your sample project (reproducing the error) using the Reply privately to author option so that I can investigate the issue?

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

ref:_00D1U1174p._5001UBo7NM:ref

Jesal Patel

unread,
Jun 20, 2019, 1:37:49 PM6/20/19
to Google Mobile Ads SDK Developers
I have the exact same issue as OP.


Mobile Ads SDK Forum Advisor Prod

unread,
Jun 20, 2019, 8:47:10 PM6/20/19
to jesalp...@gmail.com, google-adm...@googlegroups.com
Hi Jesal,


Thank you for reaching out to us.

Could you send a copy of your sample project (reproducing the error) using the Reply privately to author option so that I can investigate the issue?

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

ref:_00D1U1174p._5001UBo7NM:ref

Jesal Patel

unread,
Jun 22, 2019, 7:36:37 AM6/22/19
to Google Mobile Ads SDK Developers
Any update?

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 24, 2019, 1:32:44 AM6/24/19
to jesalp...@gmail.com, google-adm...@googlegroups.com
Hi Jesal,

Thank you for providing a copy of your sample project in private.

I was able to test your project, and can confirm that I am receiving the same crash. I've forwarded this issue to our Engineering team for them to take a look at, and will get back to you for any updates on this.


Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

ref:_00D1U1174p._5001UBo7NM:ref

Jesal Patel

unread,
Jun 24, 2019, 12:53:52 PM6/24/19
to Google Mobile Ads SDK Developers
Thanks,

Please do keep me updated!

Jesal

Jesal Patel

unread,
Jun 24, 2019, 1:12:18 PM6/24/19
to Google Mobile Ads SDK Developers
I may have an update on this myself on my part. So the editor version I was using for Unity was 2019.3.0a2 which was Unity's Alpha version. I have gone for a final version of Unity of 2019.1.8f1 which is the latest and stable version of Unity and can confirm that SmartBanners work with this version of Unity. So this could may well have been an issue with Unity potentially. So Pawan, since you're also on the same version that I was, that's what the problem is, it's the editor, I'd suggest you upgrade to the latest f version you can. 2019.1.7f1 or 2019.1.8f1 should fix it.

Jesal


On Monday, 24 June 2019 06:32:44 UTC+1, mobileadssdkforumadvisor wrote:

Jesal Patel

unread,
Jun 25, 2019, 7:59:05 PM6/25/19
to Google Mobile Ads SDK Developers
EDIT: I had to upgrade my Unity Editor once again due to some other problem with Stripping Engine Code on Unity and now I get the same Error once again with Smart Banner. The same test project I gave you would apply to now my current Unity Editor version: Unity 2019.3.0a6.

Jesal

On Monday, 24 June 2019 06:32:44 UTC+1, mobileadssdkforumadvisor wrote:

Mathijs Tieleman

unread,
Jun 27, 2019, 4:45:32 PM6/27/19
to Google Mobile Ads SDK Developers
Hi,

We are seeing probably the same crash with a slightly different stacktrace, happening a lot;
We are using the Google Mobile ads plugin 3.17. Unity 2018.4.2.

The strange part of it, is that we are using the same code (own plugin for advertising) in other apps, with the same software/plugin versions, only showing this error once in a while. But this app has a crashrate of 1% only from this crash. I can't find the differences between the apps, although they need to be there :-). So, it feels it has or something to do with certain ad campaigns running, or an implementation issue, or a bug. 


java.lang.Error: FATAL EXCEPTION [main] Unity version : 2018.4.2f1 Device model : samsung SM-G610F Device fingerprint: samsung/on7xeltedd/on7xelte:8.1.0/M1AJQ/G610FDDU1CRJ4:user/release-keys Caused by
at com.google.android.gms.internal.ads.zzaaz.zza (Unknown Source:82)
at com.google.android.gms.ads.BaseAdView.loadAd (Unknown Source:15)
at com.google.android.gms.ads.AdView.loadAd (Unknown Source:18)
at com.google.unity.ads.Banner$5.run (Banner.java:278)
at android.os.Handler.handleCallback (Handler.java:790)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:7000)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)



Op woensdag 19 juni 2019 04:35:56 UTC+2 schreef Pawan Chaurasiya:

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 27, 2019, 11:46:04 PM6/27/19
to mjtie...@gmail.com, google-adm...@googlegroups.com
Hi Pawan,

I'm afraid the Dropbox link of your sample project is giving me an error 404, and thus I can't access it.

Hi all,

Thank you for the additional details provided on this concern. The Engineering team is still working on this issue; that said, could you provide the details below using the Reply privately to author option to help with the investigation of this issue?
  • Mobile Ads SDK version used (refer to this page as a guide)
  • Google Play Services version used
  • Unity version used
  • Sample project with the error reproduced, if any (via Google Drive if possible)

The0Warrior

unread,
Jul 14, 2019, 3:25:20 PM7/14/19
to Google Mobile Ads SDK Developers
I have the same problem, so is there any update ??

The0Warrior

unread,
Jul 14, 2019, 4:29:36 PM7/14/19
to google-adm...@googlegroups.com
Thank you so much for providing the smart banner thing info, I spend 16 days trying to figure out why it crashed on start


Changing to banner fixed the issue. Hope they fix the smart banner one.

Antonio Di Bacco

unread,
Aug 7, 2019, 5:56:39 PM8/7/19
to Google Mobile Ads SDK Developers

Same thing here.
Unity 2019.2.0f1
Admob Plugin V3.18.2
Ad Resolver 1.2.124

08-07 22:56:12.318 23010 23010 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.ads.AdSize.equals(java.lang.Object)' on a null object reference
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.google.android.gms.internal.ads.zzwu.zza(com.google.android.gms:play-services-ads-lite@@18.1.1:248)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.google.android.gms.internal.ads.zzwu.zza(com.google.android.gms:play-services-ads-lite@@18.1.1:87)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.google.android.gms.ads.BaseAdView.loadAd(com.google.android.gms:play-services-ads-lite@@18.1.1:15)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.google.android.gms.ads.AdView.loadAd(com.google.android.gms:play-services-ads-lite@@18.1.1:18)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.google.unity.ads.Banner$5.run(Banner.java:278)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7076)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-07 22:56:12.318 23010 23010 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 7, 2019, 8:50:31 PM8/7/19
to a.di...@gmail.com, google-adm...@googlegroups.com
Hi Antonio,


Thank you for reaching out to us.

Kindly note that the Engineering team is already aware of this issue, and is currently working on a fix for this. In the meantime, you may set AdSize.SMART_BANNER to AdSize.BANNER instead as a workaround for the crashes.


Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

ref:_00D1U1174p._5001UEIIrf:ref

xinghu shu

unread,
Aug 14, 2024, 12:00:38 AM8/14/24
to Google Mobile Ads SDK Developers
I have a new problem.
08-13 19:48:26.971688 15779 15779 I AEE_AED : java.lang.NullPointerException: Attempt to read from field 'boolean com.google.android.gms.internal.ads.zzfgm.zzaj' on a null object reference
08-13 19:48:26.971688 15779 15779 I AEE_AED : at com.google.android.gms.internal.ads.zzfhr.zzb(Unknown Source:9)
08-13 19:48:26.971688 15779 15779 I AEE_AED : at com.google.android.gms.internal.ads.zzgek.run(Unknown Source:29)
08-13 19:48:26.971688 15779 15779 I AEE_AED : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
08-13 19:48:26.971688 15779 15779 I AEE_AED : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
08-13 19:48:26.971688 15779 15779 I AEE_AED : at java.lang.Thread.run(Thread.java:919)
08-13 19:48:26.971711 15779 15779 I AEE_AED : $** *** *** *** *** *** *** *** Exception *** *** *** *** *** *** *** **$

Mobile Ads SDK Forum Advisor

unread,
Aug 14, 2024, 6:04:32 AM8/14/24
to xing...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

Could you confirm if you are encountering any issues related to crashes or ANR? If so, please verify if the mentioned problem can be reproduced in our Google sample project? Should this be the case, kindly provide the following information privately, so we can review it and attempt to replicate the issue. Upon doing so, we will be better equipped to offer a suitable solution.

  • ad unit ID
  • Sample project reproducing the issue
  • Steps to replicate the issue
  • The full stack trace

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files via reply to author option or by performing the following steps:

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5001U00000EIIrfQAH&entry.80707362=00011683

2. Fill out all fields and attach your file(s).

3. Please reply on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:!00D1U01174p.!5001U0EIIrf:ref" (ADR-00011683)

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages