I try to migrate to Compose 1.6 and moved my resou...
# compose-desktop
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