Hey guys, has anyone figured out how to use Compos...
# compose
l
Hey guys, has anyone figured out how to use ComposeResources in
@Preview
in androidMain module? Even though I specify in my
build.gradle
in the
android
block this:
Copy code
sourceSets["main"].apply {
    manifest.srcFile("src/androidMain/AndroidManifest.xml")
    resources.srcDirs("src/commonMain/composeResources")
}
it still gives an exception:
org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: values/strings.xml
Please note, that it works as it should when I launch the app on Android
Maybe @Dima Avdeev , I've seen you working on multiplatform resources, do you have some suggestions please?
d
Hello! I will take a look.
­čÖĆ 1
Are you using resources like in this article ?
l
Yes exactly
d
Are you using AndroidStudio for Preview rendering?
l
Yes indeed. I used this:
Copy code
implementation(compose.preview)
implementation(compose.uiTooling)
as an android dependency (for the previews to even show since the compose-multiplatform preview didn't even make the preview start) and I have my previews in the androidMain/kotlin folder my AS version is: Android Studio Hedgehog | 2023.1.1 Patch 2 my compose multiplatform version: 1.6.0-rc01
d
For now Compose Multiplatform resources can't be used in Preview. Added an issue with this enhancement here: https://github.com/JetBrains/compose-multiplatform/issues/4338 Please follow it
l
Okay thanks. Quick question, since I saw the compose preview in the samples in commonMain here , is it possible that the preview for common will be available in 1.6.0 ?
d
We are working on it. Sorry - I can't tell before the official anouncements.
l
Sure, that works for me. Thank you