googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.36k stars 1.08k forks source link

Crashes related to AdMob Unity SDK 5.3.0 on iOS #1558

Closed novavision closed 1 year ago

novavision commented 3 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Using AdMob (from v5.3.0) we always received crash reports in Firebase Crashlytics dashboard related to GAD classes... After some researches we figured out this happened when user closed the app while watching the interstitial ad. Here is a thread in forum describing this issue, which could be fixed for for Unity 2019.3 builds and earlier. The solution provided there commenting [_UnityAppController window].rootViewController = nilinUnityCleanupTrampoline` helped, as we used Unity 2019.3

Week ago we migrated to Unity 2020.1.17. According to Unity release notes this issue had to be fixed, but in last app release found some similar GAD crashes again. Here is a note in AdMob 5.4.0 release info:

Added fix for crash that occurs when attempting to show interstitial when app is closing. Thanks @alexey-unity !

Maybe this fix would solve it, but I can't check it, because AdMob 5.4.0 require Firebase Core 7.0.x+, but we use Firebase Messaging SDK v.6.16.1, and can't move it to 7.0.x as some very important push features doesn't work there on iOS (bug reported already).

Steps to reproduce:

  1. use Unity 2020.1.x with AdMob 5.3.0 for sample project
  2. run on iOS build
  3. show interstitial ad
  4. close app just after interstitial ad appears

Relevant Code:

Here is the crash log on AdMob 5.3.0 Unity 2019.3 without commenting the line in UnityCleanupTrampoline.

Here is the crash log on AdMob 5.3.0 Unity 2020.1.17 without commenting the line in UnityCleanupTrampoline.

Here is the crash log on AdMob 5.3.0 Unity 2020.1.17 with commenting the line in UnityCleanupTrampoline.

NVentimiglia commented 1 year ago

Closing this issue as obsolete and not replicated on the most recent version. If you still have issues, please reopen.