Images disappear after build

Asked

Viewed 382 times

1

I’m developing an APP in Ionic 3, put the images in the directory Assets/img/image.png and when I run Ionic Server in the lab, they appear normally, but when I build and install APK, all the images disappear, that is, they do not appear in the emulator or the device.

  • Have you tried to put the relative path in this way?: ". /Assets/img/image.png" or ".. /Assets/img/image.png", everything depends on the structure of your project understood?

  • Already in Ionic lab they work normally, the problem and only when it generates the apk, that is after the build .. /.. /Assets/img/image.png

1 answer

1


The problem is relative path.

How it works in the emulator:

<img src="../assets/img/teste.png">

So you must work on the device:

<img src="assets/img/teste.png">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.