Skip to content

Commit 187e981

Browse files
committed
Fix the Java 21 deprecation error when compiling the :app module
1 parent 150484e commit 187e981

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

build.gradle

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ allprojects {
3030
}
3131
tasks.withType(KotlinCompile).all {
3232
kotlinOptions {
33-
jvmTarget = JavaVersion.VERSION_1_8
3433
allWarningsAsErrors = true
3534
}
3635
}
@@ -43,6 +42,30 @@ task clean(type: Delete) {
4342
}
4443

4544
subprojects {
45+
plugins.withId("com.android.application") {
46+
android {
47+
compileOptions {
48+
sourceCompatibility JavaVersion.VERSION_1_8
49+
targetCompatibility JavaVersion.VERSION_1_8
50+
}
51+
}
52+
}
53+
plugins.withId("com.android.library") {
54+
android {
55+
compileOptions {
56+
sourceCompatibility JavaVersion.VERSION_1_8
57+
targetCompatibility JavaVersion.VERSION_1_8
58+
}
59+
}
60+
}
61+
plugins.withId("org.jetbrains.kotlin.android") {
62+
tasks.withType(KotlinCompile).configureEach {
63+
kotlinOptions {
64+
jvmTarget = "1.8"
65+
}
66+
}
67+
}
68+
4669
configurations {
4770
ktlint
4871
}

0 commit comments

Comments
 (0)