Cordoba iOS Cross-Source Requests Supported for HTTP Only

I am building an iOS application and recently upgraded cordova-ios to 4.1.0 and started using: cordova-plugin-wkwebview-engine.

The problem is that now I get the error Cross origin requests are only supported for HTTP when I try to download the dependencies, so the application will not start.

It tries to load systemjs dependencies from file: //, but I included it in my config.js.

I do not know how to fix this. Does anyone have any experience with this beviour?

cordova version: 6.1.0 cordova ios version: 4.1.0

the associated config.xml bit:

 <access origin="*" /> <feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> 
+6
source share
1 answer

I had the same problem with my cordova project (actually Ionic v1) and I fixed it with the following command:

 cordova plugin add https://github.com/apache/cordova-plugins.git#wkwebview-engine-localhost 

This will install a web server that runs locally and after that the error should go away. After running this command, just run:

 cordova prepare ios 

or remove all plugins and reinstall:

 rm -rf plugins/ cordova platform add ios 

Make sure this is in your config.xml file:

 <access origin="*" /> <feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> 
+2
source

All Articles