iOS App Crashes After Updating to GoogleMobileAds 9.3.0 SDK When App Returns from the Background

322 views
Skip to first unread message

TheiOSDeveloper

unread,
Apr 15, 2022, 11:18:22 AM4/15/22
to Google Mobile Ads SDK Developers
After updating my app to include GoogleMobileAds 9.3.0 SDK I am getting crashes all the time when my app returns from the background.

Steps to reproduce:
1) Run the app.
2) Return to the iOS Home Screen.
3) Tap the app icon to bring it back to the foreground.
4) Crash most of the time.

Crash logs look like this:

0   CoreFoundation                   0x1986d79d8 __exceptionPreprocess + 216 (NSException.m:199)

1   libobjc.A.dylib                  0x1aca5ab54 objc_exception_throw + 56 (objc-exception.mm:565)

2   CoreFoundation                   0x1985e650c +[NSException raise:format:arguments:] + 96 (NSException.m:146)

3   Foundation                       0x1998e0878 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 128 (NSException.m:231)

4   MyProc                         0x1014603ec __destroy_helper_block_e8_40s48r56r64r + 6124

5   MyProc                         0x10145d9e0 GAD_GADSizedAdView_arm64_9_3_0 + 67511

6   MyProc                         0x101451ad8 GAD_GADSizedAdView_arm64_9_3_0 + 18607

7   MyProc                         0x10144e838 GAD_GADSizedAdView_arm64_9_3_0 + 5647

8   MyProc                         0x10145c468 GAD_GADSizedAdView_arm64_9_3_0 + 62015

9   MyProc                         0x10144e7e4 GAD_GADSizedAdView_arm64_9_3_0 + 5563

10  MyProc                         0x10140f510 GAD_GADAdVerificationReporter_arm64_9_3_0 + 1439

11  MyProc                         0x1013f1ffc GAD_GADAdVerificationMonitor_arm64_9_3_0 + 1387

12  MyProc                         0x1013f20a0 GAD_GADAdVerificationMonitor_arm64_9_3_0 + 1551

13  MyProc                         0x1013f1eb0 GAD_GADAdVerificationMonitor_arm64_9_3_0 + 1055


--


Any ideas on what could be going on here? Thanks in advance.

TheiOSDeveloper

unread,
Apr 15, 2022, 11:21:33 AM4/15/22
to Google Mobile Ads SDK Developers
I also should mention that I cannot reproduce this crash in the debug environment. It only is happening on the release build.

TheiOSDeveloper

unread,
Apr 15, 2022, 12:49:09 PM4/15/22
to Google Mobile Ads SDK Developers
I was finally able to reproduce the issue in the Debug environment by using my real adUnitID on the GADBannerView instead of the testing id.

Then suddenly the exception reveals itself (though it's not part of my code):

*** Assertion failure in -[GADOMIDStateWatcher adSessionDidBecomeActive:],

GADOMIDStateWatcher.m:75

2022-04-15 12:41:01.091665-0400 MyProcess[58011:4360795] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Window container should not be nil'


Not sure how I can work around this issue? 

TheiOSDeveloper

unread,
Apr 18, 2022, 12:49:07 PM4/18/22
to Google Mobile Ads SDK Developers
Someone else posted the same issue on stack overflow. (See here: https://stackoverflow.com/questions/71899292/admob-crash-on-ipad-with-window-container-should-not-be-nil)

In my app this is causing enormous amounts of crashes. This basically is torpedoing any app using GoogleMobileAds SDK on iOS. This exception is inappropriate and I think it should be a high priority bug. To reproduce the issue don't use a testing adUnitID, use a real adUnitID.

Allen

unread,
Apr 21, 2022, 2:20:51 PM4/21/22
to Google Mobile Ads SDK Developers
I found the same bug. Did you find the work around? 

Allen

unread,
Apr 21, 2022, 2:51:37 PM4/21/22
to Google Mobile Ads SDK Developers
It seems downgrade to 8.13.0 version fixed the problem?
Message has been deleted

TheiOSDeveloper

unread,
Apr 21, 2022, 3:00:30 PM4/21/22
to Google Mobile Ads SDK Developers
It's a real nasty bug. Doesn't seem like they are treating it as a high priority bug like they should but it'll basically ruin your app. It's causing crashes all over iOS (most developers don't realize it because it typically is only happening on release builds, not when they are testing with a test ad identifier).

Only possible workarounds are
1) Downgrade.
 or 
2) Swizzle the method that's doing this ridiculous assert.

Why they are asserting only when a real app identifier is being used is beyond me. An ad framework has no business crashing a released version of an app....on purpose. 

Mobile Ads SDK Forum Advisor

unread,
Apr 22, 2022, 10:30:48 AM4/22/22
to hex...@gmail.com, google-adm...@googlegroups.com
Hi Allen,

I work along with Princess. Allow me to assist you in this.

I've tried to reproduce the reported issue using our sample app, and I'm afraid that I can't replicate it on my end. In order for us to check this further, could you kindly share a test project where the issue is reproducible?
 

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 with me by performing the following steps:

 

1. Navigate to

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

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

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



Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2a3ewL:ref

Mobile Ads SDK Forum Advisor

unread,
Apr 22, 2022, 10:31:55 AM4/22/22
to in...@apptyrant.com, google-adm...@googlegroups.com
Hi TheiOSDeveloper,

Thank you for sharing your workaround to the community. As per the reported issue, is this reliably reproducible on your end? If so, could you kindly share to us a project where the  issue reproducible?
Reply all
Reply to author
Forward
0 new messages