From 5eacced78942987862d202970ea39ea0969a8734 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 11 Jul 2026 12:54:02 +0000 Subject: [PATCH] Bump AGP 9.2.0 to 9.2.1 (R8 ClassNotFoundException fix) AGP 9.2.1 fixes java.lang.ClassNotFoundException on com.android.tools.r8.RecordTag after upgrading Gradle to 9.x with AGP 9.2.0. Both android-llmservice and .github/android-consumer-test run R8 (isMinifyEnabled = true) in their release builds, so this is a real, not hypothetical, regression for this project. Updates the pinned plugin version in both settings.gradle.kts files and the matching CLAUDE.md/README.md notes (also fixing stale "Kotlin 2.4.0" wording left over from the built-in-Kotlin migration). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015qu2VUdHXRhp6ndxJGkxri --- .../android-consumer-test/settings.gradle.kts | 6 +++++- CLAUDE.md | 8 ++++++-- android-llmservice/README.md | 2 +- android-llmservice/settings.gradle.kts | 16 ++++++++++------ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/android-consumer-test/settings.gradle.kts b/.github/android-consumer-test/settings.gradle.kts index 990cc104..f1295777 100644 --- a/.github/android-consumer-test/settings.gradle.kts +++ b/.github/android-consumer-test/settings.gradle.kts @@ -16,7 +16,11 @@ pluginManagement { plugins { // AGP 9.x requires Gradle >= 9.4.1 — see the gradle-version pins on the CI jobs // that build this fixture in publish.yml (package-android-aar, test-android-emulator). - id("com.android.application") version "9.2.0" + // 9.2.1 (not 9.2.0) is pinned: it fixes a real R8 regression + // (java.lang.ClassNotFoundException on com.android.tools.r8.RecordTag after + // upgrading Gradle to 9.x with AGP 9.2.0) that hits this fixture directly since + // buildTypes.release sets isMinifyEnabled = true. + id("com.android.application") version "9.2.1" } } diff --git a/CLAUDE.md b/CLAUDE.md index a2766140..d54910d8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1652,9 +1652,13 @@ compiles/loads the API); this one has a UI and is driven end-to-end. The name is domain is the only string that must be globally unique. Structure (mirrors the consumer-test's plumbing): -- **`settings.gradle.kts`** — `rootProject.name = "android-llmservice"`; pins AGP `9.2.0` + the +- **`settings.gradle.kts`** — `rootProject.name = "android-llmservice"`; pins AGP `9.2.1` + the Compose compiler plugin (`2.4.0`); `mavenLocal()` first so the freshly-built AAR + façade - resolve there in CI (Maven Central for real users). AGP 9.x requires Gradle >= 9.4.1 and + resolve there in CI (Maven Central for real users). `9.2.1` (not `9.2.0`) fixes a real R8 + regression (`ClassNotFoundException` on `com.android.tools.r8.RecordTag` after upgrading + Gradle to 9.x with AGP 9.2.0) that hits this project directly since `buildTypes.release` + sets `isMinifyEnabled = true`; the `.github/android-consumer-test` fixture is pinned the + same way for the same reason. AGP 9.x requires Gradle >= 9.4.1 and JDK 17+; CI already runs JDK 21 everywhere (`env.JAVA_VERSION`), so only the `gradle-version` pin on the jobs that build this project (and the `.github/android-consumer-test` fixture) needed bumping. AGP 9.0+ has **built-in Kotlin support** (a runtime dependency on Kotlin diff --git a/android-llmservice/README.md b/android-llmservice/README.md index 27cc8a41..dba224f4 100644 --- a/android-llmservice/README.md +++ b/android-llmservice/README.md @@ -197,7 +197,7 @@ gradle -p android-llmservice connectedDebugAndroidTest -PjllamaVersion="$VERSION ``` android-llmservice/ -├── settings.gradle.kts # AGP 9.2.0 + Kotlin 2.4.0 + Compose plugin, mavenLocal first +├── settings.gradle.kts # AGP 9.2.1 (built-in Kotlin) + Compose plugin 2.4.0, mavenLocal first ├── gradle.properties ├── requirements.md # spec of record: every feature the app implements today (no unit tests) ├── TODO.md # roadmap: not-yet-built features diff --git a/android-llmservice/settings.gradle.kts b/android-llmservice/settings.gradle.kts index 60c858f0..37ad3a12 100644 --- a/android-llmservice/settings.gradle.kts +++ b/android-llmservice/settings.gradle.kts @@ -15,13 +15,17 @@ pluginManagement { } // Versions pinned here (KISS: no version catalog). AGP matches the consumer-test // fixture. AGP 9.x requires Gradle >= 9.4.1 — see the gradle-version pins on the CI - // jobs that build this project in publish.yml. AGP 9.0+ has built-in Kotlin support - // (runtime dependency on Kotlin Gradle plugin 2.2.10+), so the standalone - // org.jetbrains.kotlin.android plugin is no longer applied/needed — see - // https://developer.android.com/build/migrate-to-built-in-kotlin. The Compose - // compiler plugin (2.4.0) still applies separately and exceeds AGP's 2.2.10 floor. + // jobs that build this project in publish.yml. 9.2.1 (not 9.2.0) is pinned: it fixes + // a real R8 regression (java.lang.ClassNotFoundException on + // com.android.tools.r8.RecordTag after upgrading Gradle to 9.x with AGP 9.2.0) that + // hits this project directly since buildTypes.release sets isMinifyEnabled = true. + // AGP 9.0+ has built-in Kotlin support (runtime dependency on Kotlin Gradle plugin + // 2.2.10+), so the standalone org.jetbrains.kotlin.android plugin is no longer + // applied/needed — see https://developer.android.com/build/migrate-to-built-in-kotlin. + // The Compose compiler plugin (2.4.0) still applies separately and exceeds AGP's + // 2.2.10 floor. plugins { - id("com.android.application") version "9.2.0" + id("com.android.application") version "9.2.1" id("org.jetbrains.kotlin.plugin.compose") version "2.4.0" } }