Hi there. Need help with string resources on my KM...
# multiplatform
o
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
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
Thanks. But generateComposeResClass task is not found too. I believe that is root cause of a problem.
a
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
@Aleksey Zamulla thanks a lot. It works like a charm 🐕
kodee happy 1
353 Views