google / automotive-design-compose

Automotive Design for Compose is an extension to Jetpack Compose that allows every screen, component, and overlay of your Android App to be defined in Figma, and lets you see the latest changes to your Figma design in your app, immediately!
https://google.github.io/automotive-design-compose/
Apache License 2.0
112 stars 15 forks source link

Fill with image not showing on the emulator #1187

Open MarcFerrerVWGS opened 3 months ago

MarcFerrerVWGS commented 3 months ago

Hi,

Currently on figma I have several elements that has a fill with an a export image from my computer. When I add that image and wait for the live update to show the image is never displayed on the emulator.

image

Is any solution or method to load the image from figma? The only workaround is to get the name on code and load the image to the component by code, like a placeholder but I would like not to do that with all the images.

rylin8 commented 3 months ago

Images in Figma should load on the emulator. Do you happen to have an image customization set for that node in code? If so, we assume you will replace the image from Figma with something, so we don't download it.

MarcFerrerVWGS commented 3 months ago

So currently I have my component with the fill property loaded with a custom image and then I am creating an instance of it. When I load on the emulator and wait for the live update the image never shows up, is empty and in code I have nothing refering to that component or node

rylin8 commented 3 months ago

That should definitely work, and we have tests with this scenario that work as well. I would suggest a couple of things:

Are there any notable log messages that might be related? If none of this helps, please provide some example code along with a Figma document that we can use to look into the issue. Thanks!

MarcFerrerVWGS commented 3 months ago

In this zip there's the figma file with the image. I don't attach the code because I am doing nothing. Only loading the figma id document on the stage. I dont see any log or any error about that. I can't see the image on the emulator. test_figma.zip

rylin8 commented 3 months ago

Hi there, I tested this Figma design file and am able to load the image. Another suggestion is to delete the saved .dcf file on your emulator device with adb. Something like:

adb root
adb shell
find /data -name *YOUR_FIGMA_FILE_ID*
rm <PATH_TO_DCF_FILE>

Here is what my emulator looks like: Screenshot 2024-06-05 at 8 55 28 AM

MarcFerrerVWGS commented 3 months ago

Hi, I tried again and the same issue. The image is not showing. I am working with an emulator with proxy applied, can be a problem to download imges? This is the output I got:

I Read 2349 bytes of doc vaMdKCW I Successfully deserialized V18 doc. Name: test_images, last modified: 2024-06-06T05:39:31Z I Decoded 1 images for test_images I Saving doc vaMdKCW to /data/user/10/seat.cupra.coachmarks/files/StageFrameDoc_vaMdKCWyY0hXaMkooGINlB.dcf I Save doc vaMdKCW success I Live update for vaMdKCW fetched and informed 1 subscribers