我在使用JSPM CDN JavaScript、Cordova 5.1.1、TypeScript和Android时遇到以下错误:
Failed to load resource: the server responded with a status of 404 (Not Found) system@0.16.js (0,0)

我采用了默认的VS2015 TypeScript Cordova项目,并将以下内容添加到index.html:<script src="https://jspm.io/system@0.16.js"></script>
示例代码已经在Windows Phone上进行了测试,并且工作正常。我试过Android API19和22,物理设备和Genymotion(模拟器)。域访问URI已设置为*。
你知道为什么这种情况只发生在Android设备上吗?
发布于 2015-07-17 00:37:00
找到了问题所在。修复方法如下:
将自定义插件cordova-plugin-whitelist添加到项目中。可在此处下载https://www.npmjs.com/package/cordova-plugin-whitelist
我还必须将以下代码添加到index.html中的<head>标记中。
<meta http-equiv="Content-Security-Policy" content="default-src https: 'self' jspm.io; script-src 'self' 'unsafe-inline' https://jspm.io">
如果有更好的方法,请添加答案。
https://stackoverflow.com/questions/31455167
复制相似问题