dharma
August 19, 2014, 6:08am
1
I am new to ionic framework and trying out some samples.
I added a new .jpg under www–>img folder. When I run the project in a web browser using ionic serve command, I could see the .jpg rendering in the browser but when I run ionic emulate android command, the .jpg is not rendering, it seems to be broken.
Any idea how to resolve this.
thanks,
-dharma
dharma:
dharma
Hi dharma
You need to rebuild to project with
ionic build <platform>
regards
Patrick
dharma
August 19, 2014, 7:22am
3
Hi Patrick,
I tried that but still t he .jpg is not rendering in the emulator.
Please find the attached screen shot.
thanks,
-dharma
@dharma
A similar issue was discussed a while ago. Check it out: Images from image tag not loading in iOS emulator
Once you add the assets to your folder www/img
be sure you include it in your project using this:
<img ng-src="img/picture.png" width="80">
Make sure there is no /
before the src url. This fixed it for me.
Once you do this be sure to rebuild your app as @patrickdu mentioned. In your case substitute <platform>
with android
patrickdu:
ionic build <platform>
Hope this helps.
1 Like
Hi dharma
Can you look in the folder /platforms/android/www if you can find the same asset.
regards
Patrrikc
Hi @dharma ,
please check -
may be you will get solution.
dharma
August 19, 2014, 8:34am
7
@tjflamezz - thanks for your suggestion. That worked for me. I replaced src with ng-src and made sure there is no / before the ng-src url
thanks,
-dharma
Darmie
November 29, 2014, 2:59pm
8
This fix doesn’t work for me!! [Android Lollipop]