# Images not appearing when running 'ionic emulate ios' : (Resolved)

**URL:** <https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499>\
**Category:** ionic-v1\
**Created:** [May 20, 2014, 12:37am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499 "2014-05-20T00:37:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aftermathew](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aftermathew](https://forum.ionicframework.com/u/aftermathew)\
**Post date:** [May 20, 2014, 12:37am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/1 "2014-05-20T00:37:20Z")

</div>

Hey Everyone,

I’m working on an app with a bunch of images in it. They are all .png files stored within my project’s /www/ folder. Everything works great when I run in chrome for desktop using the `ionic serve` command. However, when I run `ionic build ios; ionic emulate ios` the app is missing all of it’s images – otherwise it works fine. Any ideas? Could this be an ios .png thing?

Thanks so much,

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 20, 2014, 2:39am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/2 "2014-05-20T02:39:21Z")

</div>

Are they in their folder at the ios platform level?

---

<div class="post-metadata">

**Author:** ![aftermathew](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aftermathew](https://forum.ionicframework.com/u/aftermathew)\
**Post date:** [May 20, 2014, 5:20am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/3 "2014-05-20T05:20:36Z")

</div>

@mhartington thanks for the suggestion. So in `/platforms/ios/build/emulator/HelloCordova.app/www/img` all my images are there.

Also in `/platforms/ios/www/img`

I notice that when I run `ionic serve` it appears that the browser is attempting to grab the images before angular has compiled the html. This obviously results in unloaded images briefly. Then everything loads a fraction of second later just fine. I wonder if on iOS something is getting held up and the compilation is just failing.

I’m not super experienced in the iOS emulator, but I’ll look into debugging a little more with it.

---

<div class="post-metadata">

**Author:** ![aftermathew](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aftermathew](https://forum.ionicframework.com/u/aftermathew)\
**Post date:** [May 20, 2014, 5:33am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/4 "2014-05-20T05:33:26Z")

</div>

Also, I noticed that I have some `ion-slide-box` directives with multiple images. These are filled with images via an `ng-repeat` and images that are not the first image are loading correctly.

I’ve attached a screenshot of chrome developer tools showing me that the my ‘images’ are not loading prior to angular compiling the html and converting the links to actual images. I sort of wonder if I’m loading the tabs incorrectly in a way that’s causing the browser to try and load images before angular compiles.

![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/793/dcda38c3d9cefa00.png)

**Update:** I was able to resolve the above issue in chrome by using `ng-src` as opposed to `src` with my images, but it had no impact on the ios emulator. ☹

**Update:** Running on an Android device doesn’t have the picture either. i.e., this is not limited to ios.

---

<div class="post-metadata">

**Author:** ![aftermathew](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aftermathew](https://forum.ionicframework.com/u/aftermathew)\
**Post date:** [May 20, 2014, 6:10pm UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/5 "2014-05-20T18:10:19Z")

</div>

**FIXED!:** Once I noticed that this was both platforms in Cordova I searched for this issue in Cordova in general. I found [this link](https://groups.google.com/forum/#!topic/phonegap/wSvlK8Em2HQ), and was able to quickly resolve it after that.

The short of it was that my images were being loaded with a preceding slash, such as “/img/myImage.png” as opposed to “/img/myImage.png” or “./img/myImage.png”.

Phew! This was a super simple fix.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 20, 2014, 6:28pm UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/6 "2014-05-20T18:28:32Z")

</div>

Hey sorry I about taking a while to get back to you. Glad to hear you got this resolved 😄

---

<div class="post-metadata">

**Author:** ![aftermathew](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aftermathew](https://forum.ionicframework.com/u/aftermathew)\
**Post date:** [May 20, 2014, 6:31pm UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/7 "2014-05-20T18:31:00Z")

</div>

@mhartington, Apology accepted in full! Thanks for the help and the hard work on the library.

---

<div class="post-metadata">

**Author:** ![wildcolor](https://avatars.discourse-cdn.com/v4/letter/w/e480ec/32.png) [@wildcolor](https://forum.ionicframework.com/u/wildcolor)\
**Post date:** [November 26, 2014, 12:26am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/8 "2014-11-26T00:26:54Z")

</div>

Wow. Thank you aftermathew.

I had exactly the same problem for my slidebox. Now it fixed it.

The interesting thing is I used relative image link in my CSS file like this:  
…/img/background.png And this works

But in slidebox I when used the same as above it didn’t work. I had to change it to:  
./img/background.png

Now if I go back to CSS and change it to one single dot, it wouldn’t work. Strange  
In summary, in case other people need to know this:  
**in CSS, you need 2 dots  
in HTML, you need 1 dot.**

---

<div class="post-metadata">

**Author:** ![moe\_ahmed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/moe_ahmed/32/90889_2.png) [@moe\_ahmed](https://forum.ionicframework.com/u/moe_ahmed)\
**Post date:** [September 1, 2015, 9:35am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/9 "2015-09-01T09:35:23Z")

</div>

Awesome! This also solved the issue for CSS not loading in the emulator for me. Thanks!

---

<div class="post-metadata">

**Author:** ![kurtlopez2](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@kurtlopez2](https://forum.ionicframework.com/u/kurtlopez2)\
**Post date:** [October 8, 2015, 1:27pm UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/10 "2015-10-08T13:27:14Z")

</div>

Thank you!! I was looking for this for the past few mins…

background: url("…/img/background.png")😄

---

<div class="post-metadata">

**Author:** ![acidtr](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/acidtr/32/126238_2.png) [@acidtr](https://forum.ionicframework.com/u/acidtr)\
**Post date:** [October 8, 2019, 4:11am UTC](https://forum.ionicframework.com/t/images-not-appearing-when-running-ionic-emulate-ios-resolved/4499/11 "2019-10-08T04:11:33Z")

</div>

I got a similar problem. But when I run ionic cordova build ios and then try to run with Xcode on device or emulator, some local images doesn’t load. I have checked if the images are the platforms/ios folder and nothing changed. When serving to the browser, all images load properly. Anyone can help me here?
