Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WKWebView intermittent blank screen issue

I'm integrating WKWebView to our App. And see various issues. The most annoying and blocking one is intermittent blank screen. It can be triggered my many things, navigation, zooming, etc.

When I examine the view hierarchy inside WKWebView, I can see lots of subviews are missing. When I hook up a inspector, the HTML is properly loaded. And sometimes, I can see a message in the console log:

Received an invalid message "RemoteLayerTreeDrawingAreaProxy.CommitLayerTree" from the web process.

We already filed couple of radar to Apple. Does anyone had similar problem and found a walk around?

like image 288
Cloud Xu Avatar asked Sep 15 '14 18:09

Cloud Xu


People also ask

Is WKWebView deprecated?

Since then, we've recommended that you adopt WKWebView instead of UIWebView and WebView — both of which were formally deprecated. New apps containing these frameworks are no longer accepted by the App Store.

What is the difference between UIWebView and WKWebView?

Unlike UIWebView, which does not support server authentication challenges, WKWebView does. In practical terms, this means that when using WKWebView, you can enter site credentials for password-protected websites.

Is WKWebView the same as Safari?

WKWebView - This view allows developers to embed web content in your app. You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features.


1 Answers

WKWebView's WebProcess runs out-of-process as a 64-bit process on hardware supporting 64bit. There is a 32bit/64bit marshalling IPC bug for 32 bit apps using the WKWebView client on such hardware. The bug causes the WebProcess to exit, leaving a blank screen.

You can verify this by 1) running your app on hardware that only supports 32bit and supports iOS 8 (e.g. iPad 2), or by building a 64bit version of your app. (Can build a 64 bit only version as a sanity test.)

like image 85
user791716 Avatar answered Oct 05 '22 05:10

user791716