Hi there.
Need help with string resources on my KMM + Compose project.
Got template from Kotlin Multiplatform Wizard
Trying get access to string over this tutorial:
https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-images-resources.html
and don't have success:
⢠generateComposeResClass in not found
⢠stringResource fun in not found
⢠Res is not found
string.xml put into composeResources/value folder
a
Aleksey Zamulla
02/20/2024, 1:01 PM
I'm guessing the Res class was not generated for you. You can generate it manually with the
generateComposeResClass
Gradle task.
Also, it's probably just a typo in your message, but check that it's the
composeResources/values
folder, and not
composeResources/value
.
o
owldeveloper
02/20/2024, 1:20 PM
Thanks. But generateComposeResClass task is not found too.
I believe that is root cause of a problem.
a
Aleksey Zamulla
02/20/2024, 1:30 PM
Oh, then the problem is that the default KMP wizard project comes with the stable Compose Multiplatform version 1.5.12, which makes sense. But the new resources API is only implemented in the upcoming 1.6.0.
To use a new version, change the
compose-plugin
version in the
gradle/libs.versions.toml
to
1.6.0-rc02
, for example.
A stable 1.6.0 release should happen within a week or two.
š 1
o
owldeveloper
02/20/2024, 2:02 PM
@Aleksey Zamulla thanks a lot. It works like a charm š