Search code examples
iosswiftuiadmob

Admob crash on iPad with Window container should not be nil


I am trying to integrate Admob. SDK version is 9.0.

I copied the code from

https://medium.com/geekculture/adding-google-mobile-ads-admob-to-your-swiftui-app-in-ios-14-5-5073a2b99cf9

It's working fine on iPhone Device and iPad Simulator. However, it crash on iPad Device with iOS 15.

The error log is

*** Assertion failure in -[GADOMIDStateWatcher adSessionDidBecomeActive:], GADOMIDStateWatcher.m:75

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Window container should not be nil'

It look like bugs on Admob and I am not sure about that.

Is there any other same issues like me before ? Did you fix that issue ?

enter image description here enter image description here enter image description here


Solution

  • I had the same problem. Downgrading the AdMob SDK to 8.13.0 seems to fix the problem.