" android_asset / WWW /"在没有livereload的情况下构建时从文件路径中丢失 [英] "android_asset/www/" missing from file paths when building without livereload

查看:201
本文介绍了" android_asset / WWW /"在没有livereload的情况下构建时从文件路径中丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一种离子应用程序(离子v1.7.13,cordova v5.4.1)。当我运行

I'm working on an ionic app (ionic v1.7.13, cordova v5.4.1). When I run

ionic run android -l

一切正常,所有项目文件都已正确加载。
当我尝试在没有livereload的情况下运行时出现问题,特别是因为livereload在访问设备文件时会导致问题。

everything works fine, all my project files are properly loaded. The problem arises when I try to run without livereload, specifically because livereload causes issues when accessing device files.

ionic run android

当我运行此命令时,我只看到渲染的html文件,并在开发工具中参见

When I run this command I see only the html file rendered, and in the dev tools I see

Failed to load resource: net::ERR_FILE_NOT_FOUND file:///lib/ionic/css/ionic.css
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///css/style.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/ionic/js/angular/angular-resource.js
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///lib/ngCordova/dist/ng-cordova.js
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///cordova.js
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///js/app.js
...

我可以通过并添加android_ass et / www /对于那些路线,它的工作原理......但我想我必须遗漏一些东西。

I can go through and add "android_asset/www/" to those routes and it works... but I think I must be missing something.

我正在寻找其他有此问题的人的指导。
谢谢!

I'm looking for any guidance in others who have had this issue. Thanks!

推荐答案

结果是试图将html5location包含在角度中,以便打破路线。

turns out that trying to include html5location's in angular that it breaks the routes.

从我的index.html文件中删除< base href =/> 我修复了所有相关路线和我的问题。

by removing <base href="/"> from my index.html file I fixed all the relative routes and my problem.

干杯!

这篇关于&QUOT; android_asset / WWW /&QUOT;在没有livereload的情况下构建时从文件路径中丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆