Images from src/assets/img folder are not displayed in the Ionic View


#1

Images from src/assets/img folder are not displaying in the Ionic View application on iOS using declaration:
<img src="assets/img/logo.svg" class="logo"/>

But, at the same time, locally everything displaying correctly using: ionic serve command.

For android everything works fine.
Please, advice, what I am doing wrong.


#2

Did you git add the folder?

Git add src

Tom


#3

Does it work using local Safari too?


#4

Yes. Works fine in Safari.


#5

You are testing on iOS with the simulator or real phone? what cmd / how do you deploy ?
Have you try deleting the current app on your simulator/test phone first and then deploy again?


#6

Sure. All changes are submitted to the git. Also, as I wrote earlier, Ionic View application on Android display all images.


#7

I am testing on the real device using Ionic View Application. I am just using git push ionic master. And app automatically become available for all clients through Ionic View. And for Android images displaying correctly but not for iOS.


#8

thx for all the details, I’m out of idea :frowning:


#9

Go back a step and try a starter app displaying an img from assets/?


#10

I am having the same problem here. I moved my project to Ionic Pro and now my images would not display on iOS. I have not tested with Android device but it is working well with ionic lab or ionic serve.


#11

Was a bug in the Ionic View 2.0.1 version. In 2.0.2 version this issue is fixed.
From v2.0.2 release notes: Fixed an issue with SVG images not displaying properly.
Now SVG images on iOS are displayed correctly.


#12

Try <img src="../assets/img/...." > or<img src="../../assets/img/...">
are you sure your indicating correct location of image files?


#13

As far as I know, such approach isn’t recommended. For example in conference app: github.com/ionic-team/ionic-conference-app, ../ isn’t used. And in 2.0.2 version this issue is fixed.