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

Unresolved reference when compiling a compose multiplatform project

Open cezarvancea opened this issue 1 year ago • 2 comments
trafficstars

I'm using kotlin multiplatform 2.0.20 and moko versions as per build.gradle info below.

I also attached a screenshot. I only get a build error but Android Studio does not complain about anything.. can navigate to the correct generated strings file by control-clicking the resource and all that.. Build fails though. Currently, I'm stuck. How to proceed?

I've gathered some parts of the build.gradle.kts (project level) below:

..

plugins {
    alias(libs.plugins.mokoResources.plugin) // 0.24.3
}

kotlin {
    listOf(
//        iosX64(), // Simulators for MacOS
//        iosArm64(), // Real devices
        iosSimulatorArm64() // Simulators for MacOS with M chipset
    ).forEach {
        it.binaries.framework {
            baseName = "ComposeApp"
            isStatic = true
            export(libs.moko.resources) // 0.24.3
            export(libs.moko.graphics)  // 0.10.0
        }
    }
    
    sourceSets {
        commonMain.dependencies {
            api(libs.moko.resources)            // dev.icerock.moko:resources           0.24.3
            api(libs.moko.resources.compose)    // dev.icerock.moko:resources-compose   0.24.3
            api(libs.moko.graphics)             // dev.icerock.moko:graphics            0.10.0
        }
    }
}

multiplatformResources {
    resourcesPackage = "ro.xxxxxxxxxx.xxxxxxxx"
    resourcesClassName = "SharedRes"
}

..

Screenshot 2024-10-01 at 20 29 31

cezarvancea avatar Oct 01 '24 17:10 cezarvancea