Missing html files on deployment to Android

Hello guys,

I am writing an app and I stumbled across an issue. The app loads but the template does not display on ion-nav-view.

Uppon further investigation, I realize that my folder structure is not working.
I have a pages forlder inside my www folder in which I have subfolders containing all the html files for my app.

  • Chrome tells the following message on the console while connected to
    the device: file:///android_asset/pages/wizards/firstRunScreen.html
    Failed to load resource: net::ERR_FILE_NOT_FOUND

if I move the file to the root of www, then it works. For some reason, the pages sub folder is not being copied to the android device.

how can I tell ionic to copy that folder as well?

Thanks
Luis

I have similar setup on my project at work and I don’t remember having done anything specific but I can’t check it now.

In your chrome browser in the developer tools window, do the Soruces tab show all your files? in mine index.html is empty and the other folder with html is not there.

However on the app, the index is displayed but not the sub views. So somehow maybe the html files are elsewere? and taht sources tab is an incomplete view of the filesystem.

Do you use gulp to move the files around ? like from outside www to www? or do you have your sub folders inside www?

Found what the issue was.

  • /pages/wizards/firstRunScreen.html

had a prependind /

  • pages/wizards/firstRunScreen.html

works fine.

For some reason ionic serve worked fine with it.

Thanks for the help,
Luis

1 Like

Hello! I am having the same issue! but I have tried both with / and without. My app can’t find any sub folders in www except for the ones created with the original project. Anyone knows what’s missing?

// THIS DOES WORK
.state(‘app.client’, {
url: ‘/client’,
views: {
‘menuContent’: {
templateUrl: ‘templates/client.html’,
controller: ‘ClientCtrl’
}
}
})

// THIS DOESNT WORK
.state(‘app.client’, {
url: ‘/client’,
views: {
‘menuContent’: {
templateUrl: ‘components/client/views/client.html’,
controller: ‘ClientCtrl’
}
}
})

@wdoering, I’m also facing a similar issue. Tried with and without / but with no luck. Quite frankly its not able to find any HTML files at all, other that the index.html. Below are the errors as seen in ‘chrome remote debugger’.

Failed to load resource: net::ERR_FILE_NOT_FOUND file:///templates/authenticate.html Failed to load resource: net::ERR_FILE_NOT_FOUND file:///templates/accounts/settings.html

I’m not even sure, if the path/url is properly formed. Did you find any solution ?

Finally found the problem. The unnecessary code <base href="/"/> was giving trouble, altering all the relative urls. Removed it.

3 Likes

Sorry for late response… for me it was trickier than that.
The first time I created my sub folders where the client content was… I used lower case letters… afterwards I’ve switched in the code for uppercase… but whenever I ran Ionic Run the cache files on the build process did not update the folder name structure. I had to go inside the folders and delete everything. After that, ran Ionic Run Android and it worked fine.