WKWebView not loading content in macOS Sonoma

I had a Mac app in the App Store but I have had to remove it since it stopped working in Sonoma.

It will not load content in the WKWebView giving this error in the console. It has worked for several years...

0x111000c00 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch)
0x111000c00 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
0x13402ce18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason=Crash
0x13402ce18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
0x13402ce18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: Not eagerly reloading the view because it is not currently visible
0x110030a00 - NetworkProcessProxy::didClose (Network Process 0 crash)
ProcessAssertion::remainingRunTimeInSeconds failed to get handle for process with PID=22.500
0x111000000 - [PID=22.501] WebProcessProxy::didClose: (web process 0 crash)
0x111000000 - [PID=22.501] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
0x110020a20 - ProcessAssertion: Failed to acquire RBS IndefiniteBackground assertion 'XPCConnectionTerminationWatchdog' for process because PID 0 is invalid
0x13402ce18 - [pageProxyID=6, webPageID=7, PID=22.501] WebPageProxy::processDidTerminate: (pid 22.501), reason=Crash
0x13402ce18 - [pageProxyID=6, webPageID=7, PID=22.501] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
0x13402ce18 - [pageProxyID=6, webPageID=7, PID=22.501] WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x1100008b0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'Jetsam Boost' for process with PID=22.500, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x110020900 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'NetworkProcess Foreground Assertion' for process with PID=22.500, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x110000900 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'Jetsam Boost' for process with PID=22.501, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x110020960 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Foreground Assertion' for process with PID=22.501, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x1100209c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'NetworkProcess Background Assertion' for process with PID=22.500, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
0x110020a20 - ProcessAssertion::acquireSync Failed to acquire RBS asser

Can anyone give me a hint to where to look

Answered by georgebest in 767090022

I found the problem.

Wait for it...

I had an empty CFBundleDisplayName in the Info.plist

<key>CFBundleDisplayName</key>
<string></string>

I just deleted every single line of code/config in the app until I found it :-)

If you can find crash reports in Console for com.apple.WebKit.WebContent or com.apple.WebKit.Networking, and can attach them here, they might be instructive in solving your problem.

(Also, make sure you have this entitlement: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_network_client)

I have checked the "Outgoing connections" and other network requests work fine in the app.

I was not able to find any webkit crash reports in the Console app.

I have tried the following...

  • Check that code is run on the main thread
  • Disabled all custom configurations of the web view
  • Removed embedded pugins
  • Added another wkwebview via interface builder and tried loading apple.com (same error)
  • I can load a web page in minimal test mac app

Heres a more detailed log: https://www.jonasmunk.com/public/oo-webkit-log.txt

I was unable to upload it here.

Accepted Answer

I found the problem.

Wait for it...

I had an empty CFBundleDisplayName in the Info.plist

<key>CFBundleDisplayName</key>
<string></string>

I just deleted every single line of code/config in the app until I found it :-)
WKWebView not loading content in macOS Sonoma
 
 
Q