Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"android_asset/www/" missing from file paths when building without livereload

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

ionic run android -l

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

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
...

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!

like image 338
Lucas Avatar asked Feb 04 '16 13:02

Lucas


1 Answers

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

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

Cheers!

like image 85
Lucas Avatar answered Nov 15 '22 10:11

Lucas