vanso_dev February 2016

Cordova Android CORS crypt-file plugin

I am currently developing an Android application with Cordova and am trying to use the following plugin, to encrypt the source files. https://github.com/tkyaji/cordova-plugin-crypt-file

While iOS is working fine, on Android I get the following error. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.

Without the plugin, everything is working fine. I do have the CSP set and am also using the whitelist plugin where I have added localhost in my config.xml. I have searched for quite a while now, but all seem to be solving the problem with whitelisting, which is not working for me.

I am currently using Cordova 5.4.1

Any help/idea would be appreciated. Best regards

Answers


R Silvrants March 2016

Runned into the same problem, solved this by allowing localhost request on the server for that specific action.

header("Access-Control-Allow-Origin: http://localhost");

See also the github issue: https://github.com/tkyaji/cordova-plugin-crypt-file/issues/4

Post Status

Asked in February 2016
Viewed 3,107 times
Voted 9
Answered 1 times

Search




Leave an answer