We're also seeing this issue with Xcode 16.3. The app crashes on startup on simulators running < iOS 18.4. In our case we see the issue with WKPDFConfiguration and with WKWebView.find. When we remove those from our code it runs fine.
Here's some minimal code that causes the crash (on < iOS 18.4):
import SwiftUI
import WebKit
// Add one of these in ContentView.Swift
struct WebViewRepresentable: UIViewRepresentable {
func makeUIView(context: Context) -> WKWebView {
let webView = WKWebView()
let url = URL(string: "https://apple.com")!
let request = URLRequest(url: url)
webView.load(request)
// Causes crash on < iOS 18.4
webView.find("apple") { _ in }
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) { }
}
I've also run the following: nm -gU <path-to-simulator-ios-version-runtime-frameworks>/WebKit.framework/WebKit> | grep find.
The symbols show up in iOS 18.4 but not others.
Here an example of a full path to the WebKit framework in case its useful to anyone: /Library/Developer/CoreSimulator/Volumes/iOS_22C150/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WebKit.framework.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: