Nicholas Doglio
03/25/2024, 11:27 PM-jdk-release
value but I'm running into an error message e: JDK_HOME path is not specified in compiler configuration
🧵Nicholas Doglio
03/25/2024, 11:27 PMimport org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}
android {
namespace = "dev.whosnickdoglio.issue"
compileSdk = 34
defaultConfig {
applicationId = "dev.whosnickdoglio.issue"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"<http://proguard-rules.pro|proguard-rules.pro>"
)
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.11"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}
kotlin { jvmToolchain(20) }
tasks.withType(KotlinCompile::class).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
freeCompilerArgs.add("-Xjdk-release=11")
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.material3)
}
Nicholas Doglio
03/25/2024, 11:32 PMThomas Broyer
03/26/2024, 9:59 AMUsers of the Kotlin Android plugin or the Android targets of the Kotlin multiplatform plugin do not need to do this, as the use of theas the boot classpath limits theandroid.jar
APIs to those of yourjava.*
(and Android Lint ensures you don’t use anything newer than yourcompileSdk
).minSdk
Nicholas Doglio
03/26/2024, 1:57 PM