0

I get the following error when using JSPM CDN JavaScript, Cordova 5.1.1, TypeScript and Android:

Failed to load resource: the server responded with a status of 404 (Not Found) system@0.16.js (0,0)

enter image description here

I took the default VS2015 TypeScript Cordova project and added the following to index.html: <script src="https://jspm.io/system@0.16.js"></script>

The sample code has been tested on Windows Phone and works. I have tried Android API 19 and 22, physical devices and Genymotion(emulator). Domain Access URI has been set to *.

Any ideas on why this would be happening only on Android devices?

4

1 回答 1

0

发现了问题。这是修复:

将自定义插件添加cordova-plugin-whitelist到项目中。可以在这里下载https://www.npmjs.com/package/cordova-plugin-whitelist

我还必须将以下代码添加到<head>index.html 中的标记中。

<meta http-equiv="Content-Security-Policy" content="default-src https: 'self' jspm.io; script-src 'self' 'unsafe-inline' https://jspm.io">

如果有更好的方法,请添加答案。

于 2015-07-16T16:37:00.277 回答