James Black
04/07/2022, 3:37 AMkotlin {
android()
iosX64()
iosArm64()
iosSimulatorArm64()
jvm()
Near the end I have this:
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-apache:${Versions.ktor}")
}
}
}
}
android {
compileSdk = 32
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 30
targetSdk = 32
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
freeCompilerArgs = listOf("-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xjvm-default=all"
)
}
}
It recognizes jvmMain as I had to include the expected functions.
In my server build.gradle I have:
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
id("kotlin-platform-jvm")
id("war")
id("application")
kotlin("plugin.serialization")
id("kotlinx-serialization")
}
dependencies {
implementation(project(":shared"))
Snipped rest
}
kotlin {
sourceSets.all {
languageSettings {
optIn("kotlin.RequiresOptIn")
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
When I look at anything from the shared project it goes to the androidMain version, not the jvmMain version. How do I get it to find the correct versions of the classes?James Black
04/07/2022, 3:43 AM