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