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

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.

1 Like

Did you git add the folder?

Git add src

Tom

Does it work using local Safari too?

Yes. Works fine in Safari.

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?

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

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.

2 Likes

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

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

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.

3 Likes

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.

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

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.