Adi Pilav
09/26/2023, 4:28 PMexpect
class in commonMain
and actual
implementations in androidMain
, jvmMain
and iosMain
. However, Android Studio requires me to add additional actual
implementation in main
source set, which shouldn't even exist, per my understanding at least. When I tried to use this module as a project dependency in another feature module, the feature module was actually using the implementation from the main
source set instead of androidMain
. I am using Kotlin 1.7.10 and Android Studio Electric Eel | 2022.1.1 Patch 2. Am I doing something wrong here? I'll post build.gradle
configuration in the reply.plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'com.android.library'
}
apply from: "../dependencies.gradle"
kotlin {
jvm()
android()
ios()
iosSimulatorArm64()
sourceSets {
commonMain.dependencies {
...
}
androidMain {
dependsOn(commonMain)
}
iosMain {
dependsOn(commonMain)
}
iosSimulatorArm64Main {
dependsOn(iosMain)
}
jvmMain {
dependsOn(commonMain)
}
jvmTest.dependencies {
...
}
}
}
android {
compileSdk 33
sourceSets.named("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
defaultConfig {
minSdk 24
targetSdk 33
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
Jeff Lockhart
09/26/2023, 4:42 PMAdi Pilav
09/26/2023, 4:59 PMJeff Lockhart
09/26/2023, 5:05 PM