I tried a new app with simple $http.get, $http.post and $http.put calls. I settet up an express node-server on my root-server. I’m using the latest Versions of Ionic, node, npm, express, npm cors, etc.
Im using following plugins (but i dont think they are the reason, try that later without them)
ionic plugin add org.apache.cordova.console
ionic plugin add org.apache.cordova.device
ionic plugin add org.apache.cordova.dialogs
ionic plugin add org.apache.cordova.file
ionic plugin add org.apache.cordova.media
ionic plugin add https://github.com/phonegap-build/PushPlugin
ionic plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
without the crosswalk-browser all works fine on the device.
if i add the crosswalk-browser with “ionic browser add crosswalk” i got for all http-calls a 404 error!
same here - any news?
if i inspect with chrome you can see crosswalk is loading every request “from cache”, even the first requests
what ends always in 404
Have you checked what is the url being requested? I mean, probably you are doing $http.get('some-url') and then the actual url requested may be like this one file://android_assets/some-url.
no, the request goes to the right external url (with hostname), but in chrome you can see the “from cache” flag.
the request is not sent over the network, the response comes direct from the cache (even the first request).
and its always an 404 response.
same for localhost and for direct ip’s (no hostnames).
I am also getting 404 status codes. Was working prior to introducing Crosswalk. Works fine on the desktop but not on device when Crosswalk was added. Using ionic RC2. Crosswalk version: 12.41.296.5
Thanks for the workaround! Seems like there is a very bad regression on the crosswalk plugin, as 1 month ago every crosswalk versions worked like a charm when I used it. I was banging my head on the wall today because of this dreaded 404 issue with crosswalk
Anyone knows on which bug tracker we should report this?
Just started working on adding Android support to my app and ran into this problem, but I can’t seem to get your workaround to work. Am I doing this right?
Finally, got the reason behind, this is not a bug.
Here is the Cordova android 4.0.0 changelog:
Major Changes
[...]
- Whitelist functionality is now provided via plugin (CB-7747) The
whitelist has been enhanced to be more secure and configurable
Setting of Content-Security-Policy is now supported by the framework
(see details in plugin readme) You will need to add the new
cordova-plugin-whitelist plugin Legacy whitelist behaviour is still
available via plugin (although not recommended).