webview not working on iPhone after iOS 16.1.1 update

I am using webview_flutter 3.0.4 to load a login web page in iOS I have tried both on simulator and on device the app loading it shows the webpage login page for a few milisecounds and then crashs and I get this error

WKErrorDomain WebResourceErrorType.webContentProcessTerminated

WebView_flutter uses WKWebview. The app works fine one any iOS version below 16.1.1 but on 16.1.1 the WebView crashes at the start of the app. I am using Webpage url that use OAuth 2.0 to generate a unique login challenge everytime.

This issue is related to WKWebView after updating to iOS 16.1.1 I have mange to get the native Swift code that can be used to recreate this issue.

Just create a native ios project in XCode but do not use SwiftUI as the UI framework and replace the content of the ViewController.swift file with the code below.

import WebKit

class ViewController: UIViewController, WKNavigationDelegate {
    
    var webView: WKWebView!
    private func createWebView() {
        let preferences = WKWebpagePreferences()
        preferences.allowsContentJavaScript = true
        
        let configuration = WKWebViewConfiguration()
        configuration.defaultWebpagePreferences = preferences
        
        webView = WKWebView(frame: view.bounds, configuration: configuration)
        webView.navigationDelegate = self
        
        view.addSubview(webView)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        createWebView()
        
        let url = URL(string: "https://ti.do.si-dev.net/")!
        webView.load(URLRequest(url: url))
        webView.allowsBackForwardNavigationGestures = true
    }

}
webview not working on iPhone after iOS 16.1.1 update
 
 
Q