When I run my application either in the Android emulator or on my Android device, I get he following error on all AJAX requests:
Failed to load resource: the server responded with a status of 404 (Not Found)
I have tried all the following steps to solve this problem, but it persists.
<plugin name="cordova-plugin-whitelist" version="1" />
to
config.xml.<uses-permission android:name="android.permission.INTERNET" />
to platforms\android\AndroidManifest.xml.<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline';">
and <meta http-equiv="X-XSS-Protection" content="0">
to the <head>
of www/index.html file.<access origin="*" />
, <allow-navigation href="*" />
and
<allow-intent href="*" />
to the config.xml file.Regardless I still get the same errors. Any ideas?
The project compiles fine. I'm on Windows 7, using Cordova 5.4.0, Android 5.1.1
Removing the whole Android part of the application with:
cordova platform remove android
and adding it again with:
cordova platform add android
solved the problem, which is still a mystery to me.
Perhaps there was something wrong left from the earlier versions of Cordova that wasn't getting on well with the current Cordova version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With