无法加载资源:net::ERR_FILE_NOT_FOUND 离子错误

新手上路,请多包涵

我已经安装了白名单插件并在 config.xml 中

<access origin="*"/>
<allow-navigation href="*" />

我收到错误

Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ion-autocomplete/dist/ion-autocomplete.css Failed to load   resource: net::ERR_FILE_NOT_FOUND
file:///css/ionic.app.css Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ionic/js/ionic.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ngCordova/dist/ng-cordova.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///cordova.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/moment/moment.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/angular-bootstrap/ui-bootstrap-tpls.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/angular-bootstrap-calendar/dist/js/angular-bootstrap-calendar-tpls.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/x2js/xml2json.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ionic-ajax-interceptor/dist/ionic-ajax-interceptor.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND

当我在浏览器中测试时它工作正常但在移动设备上测试时我收到上面的错误。

我已经完成了所有可用的解决方案,但现在可以修复它

谢谢

原文由 Shrijan Piya 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.9k
2 个回答

尝试添加所有这些

<access origin="*"/>
<access origin="tel:*" launch-external="yes"/>
<allow-navigation href="*"/>
<allow-navigation href="http://*/*"/>
<allow-navigation href="https://*/*"/>
<allow-navigation href="data:*"/>
<allow-intent href="*"/>
<access origin="*"/>

编辑:

到你的 config.xml 文件

原文由 Mark 发布,翻译遵循 CC BY-SA 3.0 许可协议

我遇到了同样的错误,我通过执行这两个简单的步骤修复了它

  1. ionic cordova platform remove android
  2. ionic cordova platform add android

在此之后只需运行命令 ionic cordova run android 它的工作就像一个魅力

原文由 Waleed Arshad Awan 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题