Open hitherejoe opened 1 year ago
hi. please show strings.xml
content.
and also check is path to this file is /src/commonMain/resources/MR/base/strings.xml
not /src/commonMain/resources/MR.base/strings.xml
I've got the same problem @Alex009 trying to access a custom font
my configuration to my current module:
plugins {
id(libs.plugins.multiplatform.get().pluginId)
alias(libs.plugins.compose)
id(libs.plugins.android.library.get().pluginId)
alias(libs.plugins.moko)
}
setupKMP()
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(libs.composeIcons.featherIcons)
implementation("dev.icerock.moko:resources-compose:0.23.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("dev.icerock.moko:resources-test:0.23.0")
}
}
val androidMain by getting
val androidUnitTest by getting
val iosMain by getting
val iosSimulatorArm64Test by getting
val iosTest by getting {
iosSimulatorArm64Test.dependsOn(this)
}
}
}
android {
namespace = "co.moendy.platform.design"
}
multiplatformResources {
multiplatformResourcesPackage = "co.moendy.platform.design"
multiplatformResourcesClassName = "MoendyRes"
}
my setupKmp function:
fun Project.setupKMP() {
plugins.withType<org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper> {
extensions.configure<KotlinMultiplatformExtension> {
explicitApi()
// app target
android()
ios()
iosSimulatorArm64()
sourceSets {
val commonMain by getting
val commonTest by getting
val jvmMain by creating {
dependsOn(commonMain)
}
val jvmTest by creating {
dependsOn(commonTest)
}
val androidMain by getting {
dependsOn(jvmMain)
}
val iosMain by getting
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
}
}
findAndroidExtension().apply {
setupAndroid()
sourceSets["main"].apply {
res.srcDirs("src/androidMain/resources")
manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.configureKotlinJvmOptions()
}
}
}
Kotlin 1.8.20 Gradle 8 And also the error message:
e: file:...platform/design/build/generated/moko/commonMain/src/co/moendy/platform/design/MoendyRes.kt:12:22 Expected object 'MoendyRes' has no actual declaration in module
Removing
android.defaults.buildfeatures.resvalues=false
from my gradle.properties solves to build on Android.
If I fix that on iOS I'll update here
@jcaiqueoliveira I'm having the same Issue with iOS. Did you get it to work?
Any update here? I have similar issue on a project at work. tried to create separate project to repoduce the issue but it does not generate anything except empty folders
Hello!
I'm trying to setup shared string resources, but am running into some issues. I have checked with the sample projects and I can't spot any differences to how I have implemented things, so opening an issue incase this is a bug.
My module structure is the following, with the strings.xml located in the resources/mr/base directory:
Generation happens, but there are no resources being generated. I can access
MR.strings
in my common main directory, but there are no strings present.This might be a separate issue related to my project, but I'm seeing this error within the generated file (sharing here incase it is helpful!).
My
build.gradle.kts
file for this module looks like the following:Let me know if I can provide any extra information