I've built a lib in Kotlin, which I would like to use in Kotlin backend, Android app & in swift ios app. Lib is written in plain Kotlin and it consists of 3 modules, dependent from each other. To create multiplatform/ios version of it, I've created separated module with build.gradle.kts:
plugins {
kotlin("multiplatform")
}
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
implementation(project(":myJvmModule"))
}
}
}
iosArm64 { binaries.framework("NativeFramework") }
iosX64 { binaries.framework("NativeFramework") }
tasks {
...
}
}
tasks.withType<Wrapper> {
gradleVersion = "5.3.1"
distributionType = Wrapper.DistributionType.ALL
}
Besides that, myJvmModule has build.gradle.kts:
val fasterXmlVersion: String by project
plugins {
kotlin("jvm")
}
dependencies {
// Modules
implementation(project(":myAnotherModule"))
implementation(project(":myAnotherModule2"))
// Jackson
implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version = fasterXmlVersion)
}
No matter how I try to use myJvmModule as dependency, I always receive error:
Could not resolve company:myJvmModule:0.0.1
How can I import JVM module to multiplatform module?