airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.1k stars 107 forks source link

Unresolved references when @Previews are renamed / deleted #316

Closed carlosmuvi-stripe closed 1 year ago

carlosmuvi-stripe commented 1 year ago

Hi! We're using Showkase with Paparazzi to run screenshot testing on our previews.

When a Preview gets renamed or deleted, the corresponding ShowkaseCodegen file for that module fails with unresolved reference errors instead of being regenerated. Cleaning does not help, the only solution found so far involves manually removing the outated preview references from the generated file.

See an example below after renaming the @Preview's group of a given screen.

image
stripe/stripe-android/financial-connections/build/generated/source/kapt/debug/com/stripe/android/financialconnections/FinancialConnectionsShowkaseRootModuleCodegen.kt:29:63 Unresolved reference: comstripeandroidfinancialconnectionsfeaturesresetResetDefault

Some references to our configuration:

Thank you!

vinaygaba commented 1 year ago

@carlosmuvi-stripe Are you using kapt by any chance?

carlosmuvi-stripe commented 1 year ago

yes : ) - https://github.com/stripe/stripe-android/blob/9f31ebd98097b9f395aff555c0c1532ba9ec8fea/financial-connections/build.gradle#L54

vinaygaba commented 1 year ago

Unfortunately this is a known issue that we suspect has something to do with a kapt bug. This is not an issue when you use Showkase with ksp and has been working really well for us + other users of this library as well.

vinaygaba commented 1 year ago

Closing as there's a duplicate issue currently open #273