Reputation: 65
I have added FontAwesome to my cordova app. project. I use AngularJS with Cordova using angularjs generator. In browser everything works fine but if I build&run it on android device, FontAwesome icons don't show up.
Per chrome://inspect/#devices
I see this error output:
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///home/username/workspace/cordova/appname/app/fonts/fontawesomewebfont.woff
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///home/username/workspace/cordova/appname/app/fonts/fontawesome-webfont.ttf
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///home/username/workspace/cordova/appname/app/fonts/fontawesome-webfont.svg
My fonts are included in appname/app/fonts
directory and font-awesome.css
includes
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot');
src: url('../fonts/fontawesome-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2') format('woff2'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
How can I change those absolute paths?
Upvotes: 0
Views: 1691
Reputation: 3101
You did something wrong, but what? ;-))
Your developer files (index.html, css, js, images, fonts, …) have to be in the top www folder. This is the only place, where you have to put all this files. Files outside of the www folder will be ignored.
If you build the app by cordova build, the www folder will be copied into the platform www folders. Cordova will add some cordova specific files, but it will not change your personal files.
Cordova itself can only access files inside of the www folder. If you have files outside, you have to use the file plugin.
Upvotes: 1