Ionic requests return 404 only on android, in Chrome it works fine

The thing is that there were some major changes in Cordova 4.0.0:

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).

So I installed the Cordova Whitelist plugin. And added

<allow-navigation href="http://*/*" />

in my config.xml file.


In my case, the problem was with cordova-plugin-whitelist plugin. I just removed the plugin and added it. Also enabled any requests by adding this code <access origin="*" /> in config.xml. Please find below commands:

You need to remove existing plugin by using below command:

ionic cordova plugin rm cordova-plugin-whitelist

Then just add it by using below command:

ionic cordova plugin add cordova-plugin-whitelist

Hope it helps.