Working around the NSInternalInconsistencyException Fatal Exception

4,464 views
Skip to first unread message

mobileadssdkforumadvisor

unread,
Nov 19, 2019, 6:53:23 PM11/19/19
to Google Mobile Ads SDK Developers

Google Mobile Ads SDK developers,


We have started to see increased reports of the following crash specifically on iOS 13:


Fatal Exception: NSInternalInconsistencyException

Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.


This crash is not consistently reproducible. Our diagnosis is UIWebView code itself is running code on the background thread, and the Google Mobile Ads SDK can’t work around it. We have heard reports that WKWebView does not have this NSInternalInconsistencyException crash.


If this issue is affecting you, you can enable WKWebView in your app by adding a gad_preferred_webview key with value of wkwebview in your app's Info.plist file. You can make this change programmatically:



Or, you can make this change in the property list editor:


<key>gad_preferred_webview</key>

<string>wkwebview</string>


Upon making this change, the Google Mobile Ads SDK may use UIWebView on the first request in the next session, but subsequent requests/sessions respect the WKWebView setting.


Note: One known issue of WKWebView is http://www.openradar.me/28716885. Please keep this in mind when deciding whether to move to WKWebView.


Thanks,

Eric, Google Mobile Ads SDK Team


Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages