cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.3k stars 214 forks source link

Moko resources does not work #1528

Open Urbanczyk-Marek opened 3 months ago

Urbanczyk-Marek commented 3 months ago

Description Generated resources with moko-resources does not work in paparazzi snapshot.

Steps to Reproduce Here is project to reproduce. I recommend reading the moko-resources documentation to understand how it works, but in the short version it generating resources in the build/generated/moko-resources/.

Expected behavior The strings.xml file contains a key-value pair and I want to render the value. The value is normally rendered when the application starts, but in the snapshot in paparazzi the key is rendered.

Additional information:

Screenshots I want foo_value image

This can be similar to the this issue

Urbanczyk-Marek commented 2 months ago

Any updates?

jrodbx commented 2 months ago

Paparazzi relies on the Android Gradle Plugin APIs to learn about generated resources. I took only a quick look at the accompanying gradle plugin and it looks like it doesn't register the generated resources folder as expected. could that be the issue?

Urbanczyk-Marek commented 2 months ago

I crated an issue in the moko-resources project, because I am not sure if the bug is paparazzi related or moko related. Before your comment I thought it must be a paparazzi bug, because @Preview in android studio works as expected. If I am not wrong @Preview uses layoutlib and paparazzi uses under the hood layoutlib too. I expected that if @Preview works then paparazzi screenshot works too.