iOS 18.2 Beta WKWebView Navigation Breaking loadFileURL for Local Files

I am experiencing a critical issue with WKWebView navigation in iOS 18.2 beta, specifically regarding the function webView.loadFileURL(_:allowingReadAccessTo:).

In previous versions of iOS, this function works as expected when loading valid file URLs from the app’s local directory (e.g., Application Support). However, in iOS 18.2 beta, the function fails to complete the navigation, producing a provisional navigation failure with WebKitErrorDomain, code 102 (Frame load interrupted). This issue severely impacts our app’s ability to load essential local resources, breaking core functionality.

Here’s a summary of the troubleshooting steps and findings:

  • File and Directory Verification: The url provided to loadFileURL is valid. Both the file path and parent directory exist within the app’s sandbox, and the directory is accessible.
  • Configuration: The code specifies the parent directory in the allowingReadAccessTo parameter to meet sandboxing requirements, which works on iOS 18.1 and prior releases.
  • Testing on Stable iOS Versions: The issue is exclusive to iOS 18.2 beta; testing on earlier stable iOS releases confirms that the function works as intended.

Impact: This regression severely disrupts the app’s navigation and content loading, effectively blocking access to local resources required for the WKWebView to display content properly.

The error log returned in the console is as follows:

> Error Domain=WebKitErrorDomain Code=102 "Frame load interrupted" UserInfo={_WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x303dd67e0>, NSErrorFailingURLStringKey=file:///var/mobile/Containers/Data/Application/4D128818-7E51-460E-B5D4-D2D70363EFA0/Library/, NSErrorFailingURLKey=file:///var/mobile/Containers/Data/Application/4D128818-7E51-460E-B5D4-D2D70363EFA0/Library/, NSLocalizedDescription=Frame load interrupted}

We suspect this may be due to a change in WebKit permissions in iOS 18.2 beta that affects local file handling within WKWebView.

Given that the our app relies heavily on these resources, we kindly request this issue be addressed promptly. If any additional information or sample code is required, please let us know, and we will gladly provide further details to assist in resolving this issue.

Thank you for your attention and support.

Best regards, Isabela

We are experiencing the exact same issue with 18.2. Any update on this so far?

iOS 18.2 Beta WKWebView Navigation Breaking loadFileURL for Local Files
 
 
Q