[solved] Images with Cordova not diplayed in app (but in browser)


#1

Hi!

I’ve got a crazy problem: my images aren’t displayed. I use Cordova with the framework. My images appears in browsers when I launch my app in my desktop… But they aren’t in my app (using “ionic run android”). I use relative links:

<a href="#/app/search" class="nav tab-item">
    <img src="img/btn_menu-search.png" />
</a>

Here is a part of my tree view:

 /myApp
       /www
             /img
                   btn_menu-search.png
             /js
                   app.js
             /templates
                   menu.html
             index.html

Should I use absolute links? Is my tree view wrong?

Thanks for you answers!


#2

I’ve the same tree and I use the same src path and it works on my Iphone emulator.


#3

Hi!
How do you started the cordova?
Using “cordova serve” command?
I think u should run “cordova build android” and then run “cordova serve”


#4

I’ve just found the solution: my path was exactly /myApp/www/img/charte/_2/btn_menu-seach.png. And the folder _2 doesn’t seem to be a good idea. I renamed it into “x2” and now, it works!

Thanks for your help :slight_smile: