From d8989aa95c637ec450e1845bcdfeed412d23382f Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 21 May 2026 22:45:37 -0400 Subject: [PATCH] chore(android): bump toolchain to Gradle 9.1 + AGP 9.0.1 + Kotlin 2.2.21 for JDK 25 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original 8.x toolchain choked on the ci-android image's JDK 25 with an opaque "25.0.3" error in `ktlintCheck`; Gradle 8.10's JDK compat matrix caps at 23. Modern chain: - Gradle 9.1.0 (first to support JDK 25) - AGP 9.0.1 (requires Gradle 9.1+, requires Kotlin 2.2.10+) - Kotlin 2.2.21 / KSP 2.2.21-2.0.5 (latest 2.2.x line) - Compose BOM 2026.05.01 (current; pulls ui-text-google-fonts at the BOM-managed version, so the explicit pin was dropped) AGP 9.0 breaking changes that affected us: - `kotlin-android` plugin no longer needed — AGP 9 auto-enables via `android.builtInKotlin=true` default. Removed alias from both the root build.gradle.kts and :app/build.gradle.kts. - `applicationVariants` API removed; we don't use it. - Other defaults flipped (useAndroidx, uniquePackageNames, etc.) but we already set them explicitly or weren't relying on the old defaults. Co-Authored-By: Claude Opus 4.7 (1M context) --- android/app/build.gradle.kts | 5 ++++- android/build.gradle.kts | 5 ++++- android/gradle/libs.versions.toml | 14 +++++++++----- android/gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 04dbe7e8..b6e7dc89 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,6 +1,9 @@ plugins { alias(libs.plugins.android.application) - alias(libs.plugins.kotlin.android) + // kotlin-android removed: AGP 9.0+ auto-enables Kotlin via the + // android.builtInKotlin=true default. The serialization + compose-compiler + // plugins still need explicit application because they're language-level + // (Kotlin compiler) plugins beyond what built-in Kotlin provides. alias(libs.plugins.kotlin.serialization) alias(libs.plugins.compose.compiler) alias(libs.plugins.ksp) diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 353dc366..d8425a47 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,6 +1,9 @@ plugins { alias(libs.plugins.android.application) apply false - alias(libs.plugins.kotlin.android) apply false + // kotlin-android plugin no longer needed: AGP 9.0+ auto-enables via + // android.builtInKotlin=true (default). Kept the serialization + + // compose-compiler plugins, which are language-level (Kotlin compiler) + // plugins still applied explicitly per module. alias(libs.plugins.kotlin.serialization) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.hilt) apply false diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index e154bf75..d482d198 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -1,10 +1,14 @@ [versions] -agp = "8.7.0" -kotlin = "2.0.21" -ksp = "2.0.21-1.0.27" +# Pinned for JDK 25 compat: Gradle 9.1.0 supports JDK 25, AGP 9.0.1 +# requires Gradle 9.1.0+, AGP 9.0 requires Kotlin Gradle Plugin 2.2.10+, +# KSP follows Kotlin version. See gradle-wrapper.properties for the +# Gradle version itself. +agp = "9.0.1" +kotlin = "2.2.21" +ksp = "2.2.21-2.0.5" hilt = "2.52" hilt-androidx = "1.2.0" -compose-bom = "2024.10.01" +compose-bom = "2026.05.01" nav-compose = "2.8.3" room = "2.6.1" retrofit = "2.11.0" @@ -41,7 +45,7 @@ compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } compose-material3 = { module = "androidx.compose.material3:material3" } -compose-ui-text-google-fonts = { module = "androidx.compose.ui:ui-text-google-fonts", version = "1.7.5" } +compose-ui-text-google-fonts = { module = "androidx.compose.ui:ui-text-google-fonts" } hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" } room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 9355b415..2e111328 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME