moko-resources icon indicating copy to clipboard operation
moko-resources copied to clipboard

Adding moko-resources as dependency breaks compose-multiplatform-ios-android-template

Open nicolashaan opened this issue 1 year ago • 7 comments

Steps to reproduce

  1. checkout https://github.com/JetBrains/compose-multiplatform-ios-android-template
  2. Load the iOS project template into Xcode. Check that the sample is compiling and running. Press "Hello World!" displays an image
  3. 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")**
            }
        }
  1. do Product/Clean build folder in Xcode
  2. 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

nicolashaan avatar Oct 14 '23 19:10 nicolashaan

Kotlin 1.9 and Compose 1.5 aren't supported yet

Ustimov avatar Oct 19 '23 12:10 Ustimov

I am wondering when Kotlin 1.9 and Compose 1.5 will be supported, thx

DonBin avatar Oct 23 '23 10:10 DonBin

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.

estivensh avatar Oct 28 '23 23:10 estivensh

I'm still hang on to this https://github.com/icerockdev/moko-resources/pull/575 to be able to upgrade to Kotlin 1.9.

KentVu avatar Oct 30 '23 03:10 KentVu

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.

estivensh avatar Nov 03 '23 00:11 estivensh

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

kurthuwig avatar Dec 18 '23 20:12 kurthuwig

#575 should fix compatibility with compose multiplatform resources engine

Alex009 avatar Jan 14 '24 14:01 Alex009

Sample is archivated, in 0.24.0-alpha-6 compose multiplatform supported

ExNDY avatar Apr 17 '24 05:04 ExNDY

should be fixed in 0.24.0-beta-1

Alex009 avatar Apr 19 '24 15:04 Alex009