moko-resources
moko-resources copied to clipboard
Adding moko-resources as dependency breaks compose-multiplatform-ios-android-template
Steps to reproduce
- checkout https://github.com/JetBrains/compose-multiplatform-ios-android-template
- Load the iOS project template into Xcode. Check that the sample is compiling and running. Press "Hello World!" displays an image
- Modify
shared/build.gradle.kts
:
plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.compose")
**id("dev.icerock.mobile.multiplatform-resources") version "0.23.0"**
}
//....
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
**implementation("dev.icerock.moko:resources:0.23.0")
implementation("dev.icerock.moko:resources-compose:0.23.0")**
}
}
- do Product/Clean build folder in Xcode
- Build and run the iOS App
Expected The image is displayed as in step 2
Bug The app is crashing with:
Uncaught Kotlin exception: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: compose-multiplatform.xml
Kotlin 1.9 and Compose 1.5 aren't supported yet
I am wondering when Kotlin 1.9 and Compose 1.5 will be supported, thx
how sad that it has already been 4 months and they are still trying to upgrade a version of kotlin to 1.9, which is affecting many of us.
I'm still hang on to this https://github.com/icerockdev/moko-resources/pull/575 to be able to upgrade to Kotlin 1.9.
I'm still hang on to this #575 to be able to upgrade to Kotlin 1.9.
I will create my own library easier because these changes are an eternity apart I see very poor documentation despite the great community they have and how important is this library for Kotlin Multiplatform.
I've got it working:
moko-resources disables the copy of the resources into the iOS directory. I've added this "Run script" in the build configuration and now it works again:
mkdir -p "$BUILT_PRODUCTS_DIR"/"$CONTENTS_FOLDER_PATH"/compose-resources
cp "$SRCROOT/../composeApp/src/commonMain/resources"/*.xml \
"$BUILT_PRODUCTS_DIR"/"$CONTENTS_FOLDER_PATH"/compose-resources
#575 should fix compatibility with compose multiplatform resources engine
Sample is archivated, in 0.24.0-alpha-6 compose multiplatform supported
should be fixed in 0.24.0-beta-1