Unity 4.6.4 and Android Crash

866 views
Skip to first unread message

Fraser Campbell

unread,
Apr 29, 2015, 2:28:31 PM4/29/15
to google-adm...@googlegroups.com
We are currently experiencing problems with AdMob in a Unity app with Android. The crash that we are seeing reported in HockeyApp is:

java.lang.NullPointerException: storage == null
	at java.util.Arrays$ArrayList.<init>(Arrays.java:38)
	at java.util.Arrays.asList(Arrays.java:155)
	at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source)
	at java.lang.reflect.Proxy.invoke(Proxy.java:397)
	at $Proxy3.onAdLoaded(Unknown Source)
	at com.google.unity.ads.Interstitial$1$1.onAdLoaded(Interstitial.java:50)
	at com.google.android.gms.internal.ag.onAdLoaded(Unknown Source)
	at com.google.android.gms.internal.ap$a.onTransact(Unknown Source)
	at android.os.Binder.transact(Binder.java:380)
	at com.google.android.gms.ads.internal.client.l.c(SourceFile:152)
	at com.google.android.gms.ads.internal.a.z(SourceFile:1505)
	at com.google.android.gms.ads.internal.a.a(SourceFile:890)
	at com.google.android.gms.ads.internal.o.f.a(SourceFile:131)
	at com.google.android.gms.ads.internal.o.h.run(SourceFile:116)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5221)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

We are using 2.2.1 Unity googlemobileads plugin, if that is of any help.

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Apr 29, 2015, 4:57:44 PM4/29/15
to google-adm...@googlegroups.com
From your stacktrace, it appears that the crash is taking place inside the handler for onAdLoaded. I would be curious to know what code you're using inside that handler. Also, the stacktrace references line 50 of Interstitial.java, which is one past the invocation of the onAdLoaded method -- have you modified our plugin at all?

The error you're seeing is similar to one referenced here:

Fraser Campbell

unread,
Apr 29, 2015, 6:38:09 PM4/29/15
to google-adm...@googlegroups.com
Thank you for your response. We actually think the issue is within Unity. Looking at the stack trace the listener. onAdLoaded() is called with no parameters. This triggers a call to Proxy.invoke(...., null); with the last parameter = null, which chains up to com.unity3d.player.ReflectionHelper.invoke(.... , null) and Unity bails out in their overriden implementation of invoke( ). The Java documentation says it is valid to pass null as the last param in invoke( ). This leads us to believe that Unity is not compliant in this handling. I forgot to mention that this also only happens on Android 5 since the new JVM has stricter checking.

Again, thank you for your assistance,

Fraser

Sound[3:22 

Soun[3:20 PM]
Reply all
Reply to author
Forward
0 new messages