cordova-ios icon indicating copy to clipboard operation
cordova-ios copied to clipboard

CDVWKWebViewFileXhr not found after upgrading to Cordova iOS 7.1.1 (works in 7.1.0)

Open rskrthk opened this issue 3 months ago • 1 comments

Issue Description

After upgrading from Cordova iOS 7.1.0 to 7.1.1, the plugin cordova-plugin-wkwebview-file-xhr fails to register. At runtime I get:

ERROR: Plugin 'CDVWKWebViewFileXhr' not found, or is not a CDVPlugin

This used to work fine on Cordova iOS 7.1.0.

Steps to Reproduce

  1. Create a new Cordova project.
  2. Add platform: cordova platform add [email protected]
  3. Add plugins:
    • cordova-plugin-wkwebview-file-xhr
    • (other default plugins like device, splashscreen, whitelist, etc.)
  4. Build and run on iOS.
  5. Observe runtime logs.

Expected Result

  • CDVWKWebViewFileXhr should be found and registered as a valid CDVPlugin.
  • XHR/fetch to local files should work inside WKWebView.

Actual Result

  • App crashes with error:

ERROR: Plugin 'CDVWKWebViewFileXhr' not found, or is not a CDVPlugin

  • The plugin is installed (appears in cordova plugin list and exists under platforms/ios/Plugins)

Environment

  • Cordova CLI: 12.0.0
  • Cordova iOS: 7.1.1 (works fine on 7.1.0)
  • Xcode: 16.4
  • Salesforce Mobile SDK: 13.0.2 (hybrid app)

Additional Notes

  • Same configuration works in Cordova iOS 7.1.0.
  • Issue appears only after moving to 7.1.1.
  • Possibly related to plugin mapping/registration changes in 7.1.1.

rskrthk avatar Sep 17 '25 15:09 rskrthk

You should not use cordova-plugin-wkwebview-file-xhr and instead use a scheme and hostname to get a proper origin for your app. Also you will get as bonus detailed script errors on ios if you do so. Set this in your config.xml and remove the plugin cordova-plugin-wkwebview-file-xhr:

<platform name="ios">
  <preference name="scheme" value="app" />
  <preference name="hostname" value="localhost" />
</platform>

If you still must use cordova-plugin-wkwebview-file-xhr and have problems with it, you should raise an issue on the plugin cordova-plugin-wkwebview-file-xhr, but i see, you already did it: https://github.com/oracle/cordova-plugin-wkwebview-file-xhr/issues/95

GitToTheHub avatar Dec 01 '25 14:12 GitToTheHub