Closed VolodymyrVechirko-TomTom closed 3 months ago
just check samples please
Do you mean this sample?
plugins {
kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
id("org.jetbrains.compose")
id("dev.icerock.mobile.multiplatform-resources")
}
We need to use kotlin("multiplatform") with jvm target instead of kotlin("jvm") ?
I found the root cause.
The problem was with my JVM app configuration. Now Jvm client works well with MOKO resources.
App run command: ./gradlew desktopApp:run
Updated gradle build.gradle.kts(:desktopApp)
plugins {
kotlin("jvm")
id("application")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
application {
mainClass.set("JvmAppKt")
}
dependencies {
implementation(project.project(":shared"))
}
Does MOKO resources support JVM target? I tried MOKO resources library for my KMP test project. There are 3 targets Android, iOS and jvm. Everything is Ok with Android and iOS, I can access resources. But the problem with jvm. I can't access to any of those.
The problem
val font1 = MR.fonts.roboto_medium.font -> This line causes error:
val tt = MR.assets.text1_txt.readText() -> This line causes error:
val uu = MR.files.some_json.readText() -> This line causes error:
MR.images.exit_left.image -> This line causes error:
System Info
KMP project used as a library. JVM client is a simple Kotlin app:
KMP project
I used latest version of MOKO resources 0.24.0-beta-5. My common source set structure: