I try to migrate to Compose 1.6 and moved my resources to `commonMain/composeResources/drawable` , b...
s
I try to migrate to Compose 1.6 and moved my resources to
commonMain/composeResources/drawable
, but there is no
Res
class generated.
1
1
m
Make sure that the
compose.components.resources
dependency is added to that exact module, and that module is your executable module or the main module that will be directly imported by your executable app.
s
Yes, it's in my shared module.
Copy code
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
api(compose.components.resources)
I used the component before in Compose 1.5.12
m
Weird, it happened to me a few times. If you are setting everything correctly, try to remove the resources dependency and sync and add it again and sync haha
s
Tried that, but it's not working. I guess I need to wait for Compose 1.6.1 🤷‍♂️
i
сс @Konstantin Tskhovrebov
k
you don't need to wait because we don't know what to fix 😆
😂 1
s
I assumed that someone else will have that problem too and craft you a reproducer 😉
nono 1
k
could you show the
./gradlew generateComposeResClass -i
output? and the
build.gradle.kts
file
BTW what gradle plugin you use for kotlin? multiplatform or java?
s
Multiplatform, gradle version 8.6
k
well, I need to see the build config
👍 1
s
Sent in PM, can't share in public.
👀 1
Solved! Thanks, @Konstantin Tskhovrebov It must be
implementation(compose.components.resources)
for code-gen to work, not
api(compose.components.resources)
👌 4
👌🏻 1
d
Thanks, I also had this problem and tried to fix this for ~1h
😄 1
s
Me, too. 😄 Until @Konstantin Tskhovrebov helped me. I guess it deserves a note in the docs at https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-images-resources.html
👍🏻 1
k
I will fix it today for 1.6.1
👍 1
👍🏻 1
s
Tried that, but it's not working. I guess I need to wait for Compose 1.6.1 🤷‍♂️
😂 I was right in the end. 😆
😁 1
k
@Stefan Oltmann could you file the issue on the github, plz?
s