https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
s

Stefan Oltmann

02/29/2024, 8:31 AM
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

mohamed rejeb

02/29/2024, 8:48 AM
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

Stefan Oltmann

02/29/2024, 8:49 AM
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

mohamed rejeb

02/29/2024, 8:52 AM
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

Stefan Oltmann

02/29/2024, 9:03 AM
Tried that, but it's not working. I guess I need to wait for Compose 1.6.1 🤷‍♂️
i

Ivan Matkov

02/29/2024, 9:19 AM
сс @Konstantin Tskhovrebov
k

Konstantin Tskhovrebov

02/29/2024, 9:23 AM
you don't need to wait because we don't know what to fix 😆
😂 1
s

Stefan Oltmann

02/29/2024, 9:24 AM
I assumed that someone else will have that problem too and craft you a reproducer 😉
nono 1
k

Konstantin Tskhovrebov

02/29/2024, 9:24 AM
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

Stefan Oltmann

02/29/2024, 9:28 AM
Multiplatform, gradle version 8.6
k

Konstantin Tskhovrebov

02/29/2024, 9:30 AM
well, I need to see the build config
👍 1
s

Stefan Oltmann

02/29/2024, 9:34 AM
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

Dragos Rachieru

03/01/2024, 12:36 PM
Thanks, I also had this problem and tried to fix this for ~1h
😄 1
s

Stefan Oltmann

03/01/2024, 12:37 PM
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

Konstantin Tskhovrebov

03/01/2024, 12:41 PM
I will fix it today for 1.6.1
👍 1
👍🏻 1
s

Stefan Oltmann

03/01/2024, 12:42 PM
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

Konstantin Tskhovrebov

03/01/2024, 2:56 PM
@Stefan Oltmann could you file the issue on the github, plz?
s

Stefan Oltmann

03/01/2024, 2:59 PM
4 Views