Images Not Showing in Phonegap Build Application

Images not showing in PhoneGap Build application

I was able to fix it by just throwing the images into the root folder and linking to that. May not be the best solution but it works! Hope this helps any viewers. PhoneGap Build apps require the images to be in the root folder.

Phonegap images not showing

After compilation the build.phonegap.com put your source files into "www" directory.

You can access your local image file using the following path "/android_asset/www/"

<image src='/android_asset/www/tire_selected.png' responsive />

If your image is placed in a subdirectory inside the root direcctory then you can use the following:

<image src='/android_asset/www/sub-direcctory/tire_selected.png' responsive />

Note: replace the "sub-direcctory" with your own if there is any in which the local image file is contained.

remote image not loading in cordova

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * filesystem: data:">

It fixed the issue. Just added in the head section.

Phonegap - displaying Image from external url

Updating the Phonegap client App on my phone fixed it. But first make sure to change the Content-security-policy in the meta tag as pointed by @TolgaOzses above.

<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *; img-src * " />


Related Topics



Leave a reply



Submit