Search code examples
androidimagenativescriptnativescript-vue

Nativescript Vue on android not updating image in drawable folder


I've added images to my drawable folder, namely, I've changed the image icon.png from the default to my custom image. I've also added a screen.png image

however when I try to load the image: <Image src="res://icon"></Image>

I still see the old default icon.png image and when I change the image source to screen then I get LOG from device Nexus 6P: Missing Image with resourceID: res://screen

I am using the tns preview command and using the NS Playground and NS Preview apps.

When I try to use a different approach, by adding the image to the assets/images/ folder, and refer to it as <Image src="~/images/icon.png"></Image> Then I get:

LOG from device Nexus 6P: Error in reading bitmap - java.io.FileNotFoundException: /data/data/org.nativescript.preview/files/app/images/icon.png (No such file or directory)

Can anyone offer some insight?


Solution

  • I went with adding the image to the /assets/images folder and referred to it as: <Image src="~/assets/images/icon.png"></Image>