krtko
02/02/2020, 8:59 PMbuild.gradle.kts
file for the new module
plugins {
kotlin("multiplatform")
}
kotlin {
targets {
targetFromPreset(presets.getByName("jvm"), "android")
}
sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61")
}
}
getByName("androidMain") {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.61")
}
}
}
}
Everything builds fine, but my Android module can't see the kotlin MPP onesikri
02/02/2020, 9:20 PMid("com.android.library")
to plugins {}
2. add android settings:
android {
compileSdkVersion(29)
buildToolsVersion = "29.0.2"
defaultConfig {
minSdkVersion(16)
targetSdkVersion(29)
}
sourceSets {
val main by getting { setRoot("src/androidMain") }
}
}
3. create directory src/androidMain
with some empty AndroidManifest.xml
inside it.
Now it should workkrtko
02/02/2020, 9:26 PM