Above image is present in the default img directory of ionic app.This works fine and i am able to see all images while testing on localhost using browser. However I have uploaded this app and tried checking using ionic View app. I an not getting any of the images on my Android device. what could be the reason ? how can i resolve this issue,
P.S : image path is static and not generated using any angular code.
Iām having the same problem when viewing images on my Android device (4.4.4). Iāve also tried running it on the Android Emulator using a different version (4.4.2) without any success.
Likewise Iām referencing a local image stored in myApp/www/img directory:
<img src="../img/greeting.png">
It works fine running it on my localhost, and also when serving it through the Phonegap Developer App.
OK I just found a solution, although itās a sucky one at that. Android accesses assets by a network-based URI /android_asset/www/ā¦ so you need to reference your images via:
<img src="/android_asset/www/img/greeting.png">
My images now appear properly on my android device and emulator. However it makes development and testing on my local browser a pain, as the relative paths to the images are now broken when testing locally on my browser.
If anyone has a better solution Iād love to hear it.
Thanks, I wasnāt able to view a background on emulators and devices, It was giving me errors in Safari and Chrome debuggers saying it couldnāt find the image. I have the image stored in www/img/logo.png
I changed my code from this:
But the background is not set, instead if i use the ābackgroundā attribute, then in /ionic-lab, i am seeing the background being set for both iOS and Android.
But when i build the project and run on android device, the background is not set !
In my case the image was not shown in a device and yes in the browser. The motif ended up being the dimensions of the image, it was very large. I reduced them and showed them correctly
i have placed my all images here as u can see in image
as it is not working on android device but working fine in Chrome debuggers
so what should i do ??? make a new folder with image name or something else ???
plzz suggest