Images do not appear in android build


#1

Good evening!

When I run my application in debug mode (ionic run android --livereloa -c) the images usually appear in the application.

But when compiling (android build android) the images appear broken …

What can it be?

  <ion-row class="logo-row">
    <ion-col></ion-col>
    <ion-col width-67>
      <!--<img src="http://mgasistemas.com.br/images/logo2.png"/>-->
      <img src="./../../assets/images/mga-logo.png"/>
    </ion-col>
    <ion-col></ion-col>
  </ion-row>

My pictures are in: /app/src/assets/images


#2

this will be valid one for build as well.

“assets/images/mga-logo.png”


#3

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.


#4

You have to understand that Ionic is nothing more then a single page application as you can see in your www folder.
If you want to open images or anything else from the assets folder, you open it from the index.html file in your www folder.
It hast nothing to do with the project structure in your src folder.