Crashes on Android after migrating to Unity 2018.3 when use AndroidJavaProxy class

I’ve migrate with my project from 2017.4 to 2018.3.2f1 about month ago. All work correct, so I prepared new update and released to Google Play. After that I started to receive a lot of crash reports. Here’s few examples:

java.lang.Error: FATAL EXCEPTION [Thread-191]
Unity version : 2018.3.2f1
Device model : samsung SM-A520F
Device fingerprint: samsung/a5y17ltexx/a5y17lte:8.0.0/R16NW/A520FXXU4CRF1:user/release-keys
Caused by
at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native Method)
at com.unity3d.player.ReflectionHelper.a (Unknown Source)
at com.unity3d.player.ReflectionHelper$1.invoke (Unknown Source:6)
at java.lang.reflect.Proxy.invoke (Proxy.java:913)
at $Proxy8.onAdFailedToLoad (Unknown Source)
at com.google.unity.ads.RewardBasedVideo$1$1$2.run (RewardBasedVideo.java:89)
at java.lang.Thread.run (Thread.java:764)

java.lang.Error: FATAL EXCEPTION [main]
Unity version : 2018.3.2f1
Device model : NOMU_S30 S30
Device fingerprint: alps/s12v55_mle_3m_nomu/s12v55_mle_3m_nomu:6.0/MRA58K/1493209127:user/release-keys
Caused by
at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native Method)
at com.unity3d.player.ReflectionHelper.a (Unknown Source)
at com.unity3d.player.ReflectionHelper$1.invoke (Unknown Source)
at java.lang.reflect.Proxy.invoke (Proxy.java:393)
at $Proxy9.onUnityAdsError (Unknown Source)
at com.unity3d.ads.configuration.InitializeThread$InitializeStateError$1.run (InitializeThread.java:420)
at android.os.Handler.handleCallback (Handler.java:815)
at android.os.Handler.dispatchMessage (Handler.java:104)
at android.os.Looper.loop (Looper.java:207)
at android.app.ActivityThread.main (ActivityThread.java:5697)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:766)

java.lang.UnsatisfiedLinkError:
at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native Method)
at com.unity3d.player.ReflectionHelper.a (Unknown Source)
at com.unity3d.player.ReflectionHelper$1.invoke (Unknown Source:6)
at java.lang.reflect.Proxy.invoke (Proxy.java:913)
at $Proxy11.onAdFailedToLoad (Unknown Source)
at com.google.unity.ads.RewardBasedVideo$1$1$2.run (RewardBasedVideo.java:89)
at java.lang.Thread.run (Thread.java:784)

These crashes includes problems with Google Ads and Unity Ads both. I didn’t update ad plugins after migration, so it’s not a cause of problem. Also, I found few similar reports from other developers:
https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/game-engines/lsbh6MEaY3M
Issues · googleads/googleads-mobile-unity · GitHub (bugs #841-#846)

All of these problems have few similar points:

  • they all related with $Proxy class
  • they all on Unity 2018.3

I’ve checked changelog and found that Unity devs made two bug fixes in Unity 2018.3 related with AndroidJavaProxy class. I absolutely sure, that it’s a cause of these problems, because no any similar error reports for Unity 2018.2 or earlier. Seems they add new bug into this class during these fixes.

I already sent bug report, but not sure how much time will take preparing update with fix. Hope any workaround exists.

2 Likes

Are you using il2cpp?

Could it relate to stripping the reflected parts of the code?

Can you try removing link.xml from the project and building again?

Hello,
I’m using Mono backend. Stripping is disabled.
By the way, I’m also using Chartboost Ads in my project. No crashes from that network. I’ve just analyzed their code - they don’t use AndroidJavaProxy, they used UnitySendMessage.

I’ve noticed the same thing since upgrading to Unity 2018.3.5f1. I’d also updated Ads to version 2.3.2, which I didn’t realise wasn’t verified. So I’ve just released another build with ads Version 2.0.8 (verified) and I’ll monitor the crashes over the next few days.

I’m using mono backend.

Edit: Still getting crashes with Ads 2.08. I’m going to try using Monetization 3.01 next.

We have the same thing.
We tried the Unity 2018.3.1, 2018.3.2,2018.3.3,2018.3.4,2018.3.5, 2018.3.6

also tried unity purchasing 2.0.4 and 2.0.5

we managed to reduce the number of failures from advertising by rolling back from Admob 3.15 to 3.14 but
there are still too lot of crashes like:

java.lang.Error

$Proxy7.OnProductsRetrieved

java.lang.Error: FATAL EXCEPTION [pool-3-thread-1] Unity version : 2018.3.6f1 Device model : samsung SM-T285 Device fingerprint: samsung/gtexsltexx/gtexslte:5.1.1/LMY47V/T285XXU0ARB1:user/release-keys Caused by

at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native Method)

at com.unity3d.player.ReflectionHelper.a (Unknown Source)

at com.unity3d.player.ReflectionHelper$1.invoke (Unknown Source)

at java.lang.reflect.Proxy.invoke (Proxy.java:397)

at $Proxy7.OnProductsRetrieved (Unknown Source)

at com.unity.purchasing.common.UnityPurchasing.OnProductsRetrieved (UnityPurchasing.java:24)

at com.unity.purchasing.googleplay.GooglePlayPurchasing.NotifyUnityOfProducts (GooglePlayPurchasing.java:572)

at com.unity.purchasing.googleplay.GooglePlayPurchasing.access$1000 (GooglePlayPurchasing.java:43)

at com.unity.purchasing.googleplay.GooglePlayPurchasing$5.onQueryInventoryFinished (GooglePlayPurchasing.java:531)

at com.unity.purchasing.googleplay.IabHelper$4.workWith (IabHelper.java:862)

at com.unity.purchasing.googleplay.BillingServiceManager$2.run (BillingServiceManager.java:146)

at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)

at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)

at java.lang.Thread.run (Thread.java:818)

And we have no idea what to do :(((((

Seems just wait a fix from Unity. As I wrote, they made two fixes related with this class in 2018.3. They have all information for quick repair that class.

1 Like

After 2 days and with a partial rollout to 5k of my app’s users, I haven’t had a single $Proxy crash using Ads version 3.01 and the Monetization namespace to show unity interstitial ads (rewarded and skippable). So that looks very much like it’s solved the problem I was having.

Now if only I can find out how to avoid the occasional signal 5 (SIGTRAP), code 1 (TRAP_BRKPT) crash I will be practically crash free!

The crash reporting service In your UnityConnectSettings.asset -file - do you have CrashReportingService enabled? If so, please try setting “enabled : 0” and let me know if this helps.

1 Like

Thank you so much! Yes, it’s enabled, we will try it!
Maybe you can give us some advice with one more very very often crash

java.lang.Error

com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator

java.lang.Error: FATAL EXCEPTION [main] Unity version : 2018.3.6f1 Device model : samsung SM-G930F Device fingerprint: samsung/heroltexx/herolte:8.0.0/R16NW/G930FXXU3ERKH:user/release-keys Caused by

at com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator (Native Method)

at com.unity3d.player.UnityPlayer.resume (Unknown Source:27)

at com.unity3d.player.UnityPlayerActivity.onResume (Unknown Source:5)

at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1361)

at android.app.Activity.performResume (Activity.java:7361)

at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3765)

at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3830)

at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1746)

at android.os.Handler.dispatchMessage (Handler.java:105)

at android.os.Looper.loop (Looper.java:164)

at android.app.ActivityThread.main (ActivityThread.java:6944)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

I have the same errors. I subscribe here.

I’m also getting these errors on every pre-launch report from googleplay. ~20% of devices have FATAL EXCEPTION errors related to unity purchasing or unity adverts ( java.lang.UnsatisfiedLinkError )

1 Like

Update: after a couple more days and rolling out to more users, the crash has started to reappear :frowning:

With no sign of a fix, I think I’ll have to remove Unity ads, for the time being at least.

Yes, seems it’s only fix. Unfortunatelly, this bug sometimes affects Unity IAP (I see crashes related with OnProductsRetrieved)

Yes I’ve noticed that too, in another app of mine that uses Unity IAP. Fortunately this app uses a different IAP solution so is unaffected by that crash.

Shame about the ads though, because the earnings were pretty good and I don’t know if I’ll get as much from AdMob.

Bad news for you - this bug affects Admob also. As I wrote in first post, it’s not related with code of ad networks, it’s related with Unity class (AndroidJavaProxy), which a lot of networks used for working with native part of plugin. So for me I receive similar crashes from Admob and Unity Ads both.

Ah, that sucks! :frowning:

Looks like I’ll have to move back to Unity 2018.2 then. Bit of a pain because I added some new features to the app after the upgrade to 2018.3, and I’ll have to re-implement them in the earlier version.

By the way, did you try to disable Crash reporter, as recommended @mikaisomaa ?

I have, but I haven’t released a version with that disabled yet. Have you tried it and if so have you noticed any difference?

we will release tomorrow, i’ll write the results.

1 Like

I’ve just released a version with the crash reporter disabled too. I’ll post the results here in a few days.