JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.24k stars 1.11k forks source link

UI Preview does not work inside Android Studio #4984

Closed DreamerChaserHAH closed 1 week ago

DreamerChaserHAH commented 1 week ago

Describe the bug UI Preview does not work inside Android Studio after adding a PainterResource inside commonMain/composeResources/drawable despite the project is being built successfully

Affected platforms

Versions

To Reproduce Steps to reproduce the behavior:

  1. Add a image or icon into a component For e.g,
    Icon(painterResource(Res.drawable.baseline_info_24), null)
  2. Load Preview by going to AndroidMain's MainActivity

Expected behavior Preview displaying normally

Screenshots It should display like this inside preview (this is IOS Simulator)

image

But it is displaying like this inside Android Studio Preview

image

Additional context None

MatkovIvan commented 1 week ago

Duplicate of #4932 (and #4476)