Giorgi
05/21/2024, 4:25 PMGiorgi
05/21/2024, 4:26 PMimport dev.icerock.gradle.MRVisibility
plugins {
kotlin("multiplatform") version "1.9.23"
id("dev.icerock.mobile.multiplatform-resources") version "0.24.0-beta-4"
}
multiplatformResources {
resourcesPackage = "io.github.shalva97"
resourcesVisibility = MRVisibility.Internal
}
repositories { mavenCentral() }
kotlin {
jvmToolchain(17)
jvm()
macosX64()
// linuxX64()
}
dependencies {
commonMainApi("dev.icerock.moko:resources:0.24.0-beta-4")
commonTestImplementation("dev.icerock.moko:resources-test:0.24.0-beta-4")
}
buildscript {
dependencies {
classpath("dev.icerock.moko:resources-generator:0.24.0-beta-4")
}
}
Giorgi
05/21/2024, 4:27 PMGiorgi
05/21/2024, 4:29 PMGeorge Karpenko
05/21/2024, 6:22 PMe: file:///Users/.../shared/localization/build/generated/moko-resources/commonMain/src/com/example/app/SharedRes.kt:9:22 Expected object 'SharedRes' has no actual declaration in module <project.shared:localization> for Native
so the reason was:
-using:
kotlin {
android()
ios()
sourceSets {
named("commonMain") { ... }
named("iosMain") { .... }
}
}
-instead of:
kotlin {
androidTarget()
iosArm64() // or iosX64()
// iosSimulatorArm64("ios") // add simulator target if needed
sourceSets {
commonMain { ... }
commonMain { .... }
}
}
so basically stopped using deprecated things(targets renamed, and named modules) and it worked:
gradle ver.:gradle-8.4
koltin: 1.9.23George Karpenko
05/21/2024, 7:04 PMmultiplatformResources {
resourcesPackage = "io.github.shalva97"
resourcesVisibility = MRVisibility.Internal
}
it should be resourcesPackage.set("io.github.shalva97")
and same for all other paramsGiorgi
05/22/2024, 5:46 PMGiorgi
05/22/2024, 5:46 PMGeorge Karpenko
05/22/2024, 5:54 PM0.24.0-alpha-1
multiplatformResources
requires using .set(...)
instead of =
. see release notesDjuro
05/29/2024, 11:26 AM./gradlew generateMRCommonMain
and provide the error or stacktrace