Huge Spike in crashes when admob installed in Unity 2019.3.0f5

1,426 views
Skip to first unread message

Harrison Walters

unread,
Jan 21, 2020, 1:49:18 PM1/21/20
to google-adm...@googlegroups.com
Hello,

Since upgrading my project to Unity 2019.3.0f5 and admob version 4.2.1, there has been a huge spike in crashes on my app. My app has been above the "bad behaviour threshold" for over a month now.

I can't help but notice that when I press "export project" and open my unity app in anrdoid studio, the build.gradle file for GoogleMobileAdsPlugin has 'targetsdkversion=19' (super outdated). There are no ndk abifilters present either in the GoogleMobileAdsPlugin build.gradle file. Also, along the top of the GoogleMobileAdsPlugin build.gradle file says "apply plugin: android-library" which is another deprecated feature now that com.android.library is used.

I would like to emphasize that newer versions of unity use ndk R19 now, and that 100% of unity android developers always split their binaries (ARMv7 + ARM64) and always use il2cpp in 'build options' (not Mono!) due to Google Play's 64 bit requirement. Additional info: we previously had Google Games Services but have since removed it. We previously used Ad Mediation through admob (networks we added: admob, unityads and chartboost) but have removed the code for it from our game, and PAUSED mediation on our console.

Here are some sample crash clusters I have been getting a lot recently:

#00 pc 00000000000a798e /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#1 pc 00000000000a7947 /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#2 pc 000000000040cc97 /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#3 pc 000000000040bafb /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#4 pc 000000000040b3b1 /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#5 pc 000000000040a4c7 /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#6 pc 0000000000428ff3 /data/app/myapp/split_config.armeabi_v7a.apk (offset 0xd40000)
#7 pc 0000000000587acf /data/app/myapp/oat/arm/base.odex (offset 0x551000)


 and :

at com.google.android.gms.ads.internal.video.exoplayer3.k.n
(com.google.android.gms.policy_ads_fdr_dynamite@2100...@21001004.272763194.272763194:19)
at com.google.android.gms.ads.internal.video.exoplayer3.k.onSurfaceTextureAvailable (com.google.android.gms.policy_ads_fdr_dynamite@2100...@21001004.272763194.272763194:5)
at android.view.TextureView.getHardwareLayer (TextureView.java:394)
at android.view.TextureView.draw (TextureView.java:330)
at android.view.View.updateDisplayListIfDirty (View.java:16221)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.updateDisplayListIfDirty (View.java:16216)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.updateDisplayListIfDirty (View.java:16216)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.updateDisplayListIfDirty (View.java:16216)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.draw (View.java:17259)
at android.view.View.updateDisplayListIfDirty (View.java:16221)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.updateDisplayListIfDirty (View.java:16216)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.updateDisplayListIfDirty (View.java:16216)
at android.view.View.draw (View.java:17022)
at android.view.ViewGroup.drawChild (ViewGroup.java:3777)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:3560)
at android.view.View.draw (View.java:17259)
at com.android.internal.policy.DecorView.draw (DecorView.java:801)
at android.view.View.updateDisplayListIfDirty (View.java:16221)
at android.view.ThreadedRenderer.updateViewTreeDisplayList (ThreadedRenderer.java:677)
at android.view.ThreadedRenderer.updateRootDisplayList (ThreadedRenderer.java:683)
at android.view.ThreadedRenderer.draw (ThreadedRenderer.java:797)
at android.view.ViewRootImpl.draw (ViewRootImpl.java:3000)
at android.view.ViewRootImpl.performDraw (ViewRootImpl.java:2794)
at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2382)
at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1372)
at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:6782)
at android.view.Choreographer$CallbackRecord.run (Choreographer.java:933)
at android.view.Choreographer.doCallbacks (Choreographer.java:742)
at android.view.Choreographer.doFrame (Choreographer.java:674)
at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:919)
at android.os.Handler.handleCallback (Handler.java:761)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:156)
at android.app.ActivityThread.main (ActivityThread.java:6605)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:999)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:889)

and:
java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2019.3.0f5 (44796c9d3c2c)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'HUAWEI/ATU-L22/HWATU-QG:8.0.0/HUAWEIATU-L22/157(C636):user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2020-01-21 16:57:36+0800
pid: 29918, tid: 30499, name: Thread-46 >>> com.my.appname <<<
uid: 10363
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4a
Cause: null pointer dereference
x0 0000000000000000 x1 0000000000000000 x2 0000007c176d0450 x3 0000007c176d0580
x4 0000000000000000 x5 0000000000000168 x6 0000007caf8028c0 x7 ef23a294ad47a75e
x8 0000007c2f1711ec x9 000000000000000a x10 0000000000004000 x11 0000007c176d2588
x12 0000000000000000 x13 0000007c176d2588 x14 0000007c176d24f0 x15 0000000000007723
x16 0000007c93bd3200 x17 0000007cb27632b0 x18 0000000000004000 x19 0000007c176d0580
x20 0000000000000000 x21 0000000000000000 x22 0000007c176d0450 x23 0000000000000003
x24 0000000000000000 x25 0000007c29d0a0a0 x26 0000000000000000 x27 000000009c2d6648
x28 0000000000000004 x29 0000007c176d06a8
sp 0000007c176d03c0 lr 0000007c92bdd744 pc 0000007c2f19cbf0
backtrace:
at libil2cpp.0x488bf0 (Native Method)
at libunity.0x5bb740 (Native Method)
at libunity.0x5c80a8 (Native Method)
at libunity.0x2906ac (Native Method)
at base.0x5b740 (Native Method)

Mobile Ads SDK Forum Advisor Prod

unread,
Jan 22, 2020, 6:20:59 AM1/22/20
to famishe...@gmail.com, google-adm...@googlegroups.com
Hi Harrison,

Thank you for reaching out to us. Let me do the best I can to assist you in this.

I tried our sample unity app, build it using 2019.3.0f5 and admob version 4.2.1, and I wasn't able to reproduce the issue on my end.

On the other hand, I was able to confirm that the build.gradle file for GoogleMobileAdsPlugin has 'targetsdkversion=19' and at the top it says "apply plugin: android-library" which is another deprecated feature. 

Could you confirm if the issue is reliably reproducible on your end? If so, kindly provide us a project (or at least a test project) where the issue is reproducible including its steps to trigger the behavior. This will be a big help for us to investigate the issue further. Please use the "Reply Privately to Author" option to share the details privately.

Regards,
Teejay Pimentel
Mobile Ads SDK Team 

ref:_00D1U1174p._5001USwtAh:ref

Harrison Walters

unread,
Jan 22, 2020, 3:00:35 PM1/22/20
to google-adm...@googlegroups.com
Hi Teejay, thank you for the quick reply.

I sent an invite to your emailto access my Google Play Console and view the various crash clusters, which devices/OS are affected, etc.
It works crash-free on my personal test devices, but the high number of crashes only appear among my ~100k users. I cannot reproduce it myself.

Also, a few things I noticed about Google's "sample unity app" which your team may not have considered:
1) when the project is exported for android studio, there seem to be no ndk-abi filters in Admob's build.gradle file. I think the Unity Admob Plugin may be using outdated versions of the SDK/NDK.
2) In "preferences > external tools" the following should be enabled: "JDK Installed With Unity", "SDK Tools Installed with Unity", "NDK Installed with Unity", and "Gradle Installed with Unity". Majority of unity developers will be using this default configuration.
3) in "project settings > player" the scripting backed is set to "Mono". Mono is NEVER used by app developers now that Google Play has a 64-bit requirement. IL2CPP is always used by android devs now.
4) once IL2CPP has been selected, the ARM64 checkbox must also be selected, due to Google Play's 64-bit requirement.

After doing some reading, some people have theorized it might have to do with users installing the app on an external SD card, causing the app to crash once on initial open for certain devices. Others have speculated that a "race condition" of sorts might be happening between Admob and Unity In-app-purchasing.

Thanks,
- Harrison

Mobile Ads SDK Forum Advisor Prod

unread,
Jan 23, 2020, 1:04:08 AM1/23/20
to famishe...@gmail.com, google-adm...@googlegroups.com
Hi Harrison,

Thank you for providing an extensive rundown of the issue.

I'm afraid we weren't able to receive the console access invitation that you sent. With this, could you please provide the following details via Reply privately to author option instead?
  • Crash rate
  • Affected Devices
  • Complete stack trace of the crash log
  • Previous SDK version
  • App ID and Ad Unit IDs
Once the information has been provided, I can then raise this to the rest of the team, along with all the reports thus far, in order for us to deliver a more decisive resolution to this concern.

thiagolr

unread,
Feb 16, 2020, 7:01:13 PM2/16/20
to Google Mobile Ads SDK Developers
I just realized that I have the same problem, we were having a lot of crashes and then after removing the AdMob plugin, all the crashes were gone.

To be sure, I just added the plugin again and all the crashes are back.

Is there any update on this?

Best regards,


Thiago

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 17, 2020, 1:37:59 AM2/17/20
to thiag...@gmail.com, google-adm...@googlegroups.com
Hi Thiago,

Thank you for reporting the issue to us. Would it be possible for you to provide the following details via Reply privately to author?
    • Crash rate
    • Affected Devices
    • Complete stack trace of the crash log
      Once provided, I'll raise the information to the rest of the team to get their insight as well.

      Mobile Ads SDK Forum Advisor Prod

      unread,
      Feb 18, 2020, 2:41:20 AM2/18/20
      to thiag...@gmail.com, google-adm...@googlegroups.com
      Hi there,

      Thank you for providing the requested details privately. Let me share this with the team to get their insight and to provide a decisive resolution to this issue.

      Mobile Ads SDK Forum Advisor Prod

      unread,
      Feb 18, 2020, 7:57:44 PM2/18/20
      to thiag...@gmail.com, famishe...@gmail.com, google-adm...@googlegroups.com
      Hi,

      This is Sam from the Mobile Ads SDK support team, I'll be assisting you further here.

      Can you please enumerate the crashes that are impacting your apps and give as much detail as possible about the environments in which they are appearing, ie what devices, Android API versions, Mobile Ads SDK version, etc. We can only address individual crashes and need to identify the cause or best way to reproduce the issue in order to address, stack traces, and where possible charles logs and even sample applications make things much more expedient.

      Regarding the exoplayer3 crash, this seems like an issue with the Android SDK, can you please provide a more complete stacktrace (what exception is occurring) and what devices and APIs is it occurring on most frequently, what percentage of users are seeing this issue?

      Thanks for providing additional details to enable us to dig into these issues further.

      Regards

      Sam

      ref:_00D1U1174p._5001USwtAh:ref

      thiagolr

      unread,
      Feb 19, 2020, 5:01:35 AM2/19/20
      to Google Mobile Ads SDK Developers
      Plugin Versions: 4.1.0 and 4.2.1
      Unity Versions: 2019.2.9f1 and incrementally increased up to 2019.2.21f1
      Android Versions: 5, 6, 7, 8, 9, 10

      CRASH 1

      il2cpp::vm::Method::GetParamCount(MethodInfo const*)
      scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
      ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
      UnityJavaProxy_invoke(_JNIEnv*, _jobject*, long long, _jstring*, _jobjectArray*)
      

      CRASH 2

      std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)
      std::_Rb_tree_iterator<DelayedCallManager::Callback> std::_Rb_tree<DelayedCallManager::Callback, DelayedCallManager::Callback, std::_Identity<DelayedCallManager::Callback>, std::less<DelayedCallManager::Callback>, memory_pool<DelayedCallManager::Callback> >::_M_insert_<DelayedCallManager::Callback const&>(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, DelayedCallManager::Callback const&)
      CallDelayed(CallObjectState (*)(Object*, void*), PPtr<Object>, float, void*, float, CallObjectState (*)(void*), DelayedCallManager::DelayedCallMode)
      Coroutine::HandleIEnumerableCurrentReturnValue(ScriptingObjectPtr)
      Coroutine::ProcessCoroutineCurrent()
      Coroutine::Run(bool*)
      MonoBehaviour::TryCreateAndRunCoroutine(ScriptingObjectPtr, ScriptingMethodPtr, Coroutine**)
      MonoBehaviour::StartCoroutineManaged2(ScriptingObjectPtr)
      MonoBehaviour_CUSTOM_StartCoroutineManaged2(ScriptingBackendNativeObjectPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
      EventHandler_1_Invoke_mBF3979EE17B68658C4C1AB3A8D64B24F263E3B98_gshared
      EventHandler_1_Invoke_mBF3979EE17B68658C4C1AB3A8D64B24F263E3B98_gshared
      RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_RuntimeObject(void (*)(), MethodInfo const*, void*, void**)
      il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
      

      CRASH 3

      std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)
      std::_Rb_tree<DelayedCallManager::Callback, DelayedCallManager::Callback, std::_Identity<DelayedCallManager::Callback>, std::less<DelayedCallManager::Callback>, memory_pool<DelayedCallManager::Callback> >::erase[abi:cxx11](std::_Rb_tree_const_iterator<DelayedCallManager::Callback>)
      DelayedCallManager::Update(int)
      ExecutePlayerLoop(NativePlayerLoopSystem*)
      ExecutePlayerLoop(NativePlayerLoopSystem*)
      PlayerLoop()
      UnityPlayerLoop()
      nativeRender(_JNIEnv*, _jobject*)
      Reply all
      Reply to author
      Forward
      0 new messages