I have the same problem here. Whenever I'm trying to show a WKWebkitView in a SwiftUI environment the app stops with the following error: Thread 8: EXC_BREAKPOINT (code=1, subcode=0x1053a8530)
And this stack trace:
#0 0x00000001053a8530 in _dispatch_sema4_timedwait.cold.3 ()
#1 0x0000000105371f84 in _dispatch_sema4_timedwait ()
#2 0x0000000105372508 in _dispatch_semaphore_wait_slow ()
#3 0x0000000196af2a0c in _copyResultPreferenceXPCCall(__CFString const*, bool, void const*, bool*) ()
#4 0x0000000196af1ea8 in MAPreferencesCopyProfileValue ()
#5 0x0000000196af20a0 in MAPreferencesCopyProfileValueWithExpectedType ()
#6 0x0000000196aefcc8 in MACaptionAppearancePrefCopyPreferredLanguages ()
#7 0x0000000196aeb990 in MACaptionAppearanceCopySelectedLanguages ()
#8 0x000000018af971c0 in WebCore::CaptionUserPreferencesMediaAF::platformPreferredLanguages() ()
#9 0x000000018921c244 in invocation function for block in WebKit::WebProcessPool::setMediaAccessibilityPreferences(WebKit::WebProcessProxy&) ()
#10 0x0000000105370028 in _dispatch_call_block_and_release ()
#11 0x0000000105371828 in _dispatch_client_callout ()
#12 0x0000000105374118 in _dispatch_queue_override_invoke ()
#13 0x0000000105383d24 in _dispatch_root_queue_drain ()
#14 0x0000000105384814 in _dispatch_worker_thread2 ()
#15 0x00000001c80effec in _pthread_wqthread ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0 0x0000000105375c54 in dispatch_async ()
#1 0x000000018921c1b0 in WebKit::WebProcessPool::setMediaAccessibilityPreferences(WebKit::WebProcessProxy&) ()
#2 0x00000001892e5110 in WebKit::WebProcessPool::initializeNewWebProcess(WebKit::WebProcessProxy&, WebKit::WebsiteDataStore*, WebKit::WebProcessProxy::IsPrewarmed) ()
#3 0x00000001892e5490 in WebKit::WebProcessPool::createNewWebProcess(WebKit::WebsiteDataStore*, WebKit::WebProcessProxy::IsPrewarmed) ()
#4 0x00000001892e6ac0 in WebKit::WebProcessPool::processForRegistrableDomain(WebKit::WebsiteDataStore&, WebKit::WebPageProxy*, WebCore::RegistrableDomain const&) ()
#5 0x00000001892e6ddc in WebKit::WebProcessPool::createWebPage(WebKit::PageClient&, WTF::Ref<API::PageConfiguration, WTF::RawPtrTraits<API::PageConfiguration> >&&) ()
#6 0x0000000189648214 in -[WKContentView _commonInitializationWithProcessPool:configuration:] ()
#7 0x0000000189648cac in -[WKContentView initWithFrame:processPool:configuration:webView:] ()
#8 0x00000001891667f0 in -[WKWebView _initializeWithConfiguration:] ()
#9 0x00000001891679ec in -[WKWebView initWithFrame:configuration:] ()
#10 0x0000000104f8a404 in @nonobjc WKWebView.init(frame:configuration:) ()
#11 0x0000000104f896a0 in WKWebView.__allocating_init(frame:configuration:) ()
I'm using an M1 MacBook Air with macOS 11.5.2, Xcode 13.0 beta 5 (13A5212g) and the iOS 15 simulator. This only happens on the simulator. It works just fine on my iPhone SE 2020 running iOS 15 beta 8.
I also see this somewhat cryptic message in the debug, both when running on simulator and on device:
Writing analzed variants.