Reputation: 577
If I add coroutines dependency I can use it in shared module.
But if I add my own Kotlin library with MyClass
class in it, I can't see MyClass
in shared module:
val commonMain by getting {
dependencies {
implementation(project(":myKotlinLib"))
}
}
How can I mark my library module to be "compatible" with KMM shared module?
There is myKotlinLib
's gradle config:
plugins {
id 'java-library'
id 'kotlin'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
I've created the lib using File -> New -> Module -> Java or Kotlin library (Language: Kotlin)
UPD
I've noticed that Build tab has an error:
Upvotes: 1
Views: 1332
Reputation: 119
How did you import the lib
files?
You might want to import it to a SharedModule
folder neither androidApp
nor iOSApp
Upvotes: 0
Reputation: 577
I tried to connect a regular Kotlin library but in commonMain of module marked as kotlin("multiplatform")
in plugins { ... }
section we can connect only dependencies witch are kotlin("multiplatform")
too
Upvotes: 1