From ce820e24f74e88dddb60da5c4f9793e6b2a178bf Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:59:23 +0900 Subject: [PATCH 1/2] chore(android): support AGP 9 built-in Kotlin --- android/build.gradle | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index dbc0cb96b..de68b7832 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,7 +22,11 @@ allprojects { } apply plugin: "com.android.library" -apply plugin: "kotlin-android" + +def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize(".")[0] as int +if (agpMajor < 9) { + apply plugin: "kotlin-android" +} android { if (project.android.hasProperty("namespace")) { @@ -36,10 +40,6 @@ android { targetCompatibility = JavaVersion.VERSION_1_8 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } - sourceSets { main.java.srcDirs += "src/main/kotlin" test.java.srcDirs += "src/test/kotlin" @@ -68,3 +68,9 @@ android { } } } + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 + } +} From f02d2487ccad17deefe687185e00a40b75e6321b Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:59:34 +0900 Subject: [PATCH 2/2] chore: add changeset for AGP 9 Kotlin migration --- .changes/agp9-built-in-kotlin | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changes/agp9-built-in-kotlin diff --git a/.changes/agp9-built-in-kotlin b/.changes/agp9-built-in-kotlin new file mode 100644 index 000000000..bb0857676 --- /dev/null +++ b/.changes/agp9-built-in-kotlin @@ -0,0 +1 @@ +patch type="fixed" "Android plugin compatibility with AGP 9 built-in Kotlin"