【发布时间】:2016-04-14 03:03:03
【问题描述】:
当我在 Android 模拟器或我的 Android 设备上运行我的应用程序时,我在所有 AJAX 请求上都收到以下错误:
Failed to load resource: the server responded with a status of 404 (Not Found)
我已经尝试了以下所有步骤来解决这个问题,但它仍然存在。
- 使用 npm 将白名单插件安装到项目中。
- 已将
<plugin name="cordova-plugin-whitelist" version="1" />添加到 config.xml。 - 已添加
<uses-permission android:name="android.permission.INTERNET" />到platforms\android\AndroidManifest.xml。 - 在 www/index.html 文件的
<head>中添加了<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline';">和<meta http-equiv="X-XSS-Protection" content="0">。 - 添加了
<access origin="*" />、<allow-navigation href="*" />和<allow-intent href="*" />到 config.xml 文件。
不管我仍然遇到同样的错误。有什么想法吗?
项目编译良好。我在 Windows 7 上,使用 Cordova 5.4.0、Android 5.1.1
【问题讨论】:
标签: android apache cordova xss