build(deps): bump Android Gradle Plugin to 9.3.0 on JDK 21 only#443
Merged
Conversation
Supersedes #438. AGP 9.3.0's bundled lint calls java.util.List.removeLast() (a JDK 21 SequencedCollection API), so `./gradlew lint` crashes with NoSuchMethodError under JDK 17 while passing under JDK 21. Rather than drop JDK 17 coverage, parameterize the AGP version: - build.gradle reads it from the `agpVersion` Gradle property - gradle.properties defaults it to 9.2.1 (keeps JDK 17, and the JDK-17 test_app publish step, building on the plugin that supports JDK 17) - the build workflow overrides it to 9.3.0 only on the JDK 21 matrix leg via ORG_GRADLE_PROJECT_agpVersion JDK 17 continues to build/lint/test on AGP 9.2.1; JDK 21 exercises 9.3.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KxmJDWq6wgCEimH3tGLF5H
tony19
marked this pull request as ready for review
July 19, 2026 07:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts Android Gradle Plugin 9.3.0, but only on the JDK 21 build leg — superseding Dependabot's #438, which bumped AGP to 9.3.0 unconditionally and broke the JDK 17 CI build.
Why #438 fails
AGP 9.3.0's bundled Android Lint calls
java.util.List.removeLast()— a method added toListin JDK 21 (SequencedCollection). Under JDK 17 that method doesn't exist, so./gradlew lintcrashes:Build (JDK 21)passed; onlyBuild (JDK 17)failed, and only at thelintstep (assemble, bytecode verification, and unit tests all pass under JDK 17 + AGP 9.3.0).Approach
Keep JDK 17 coverage by making the AGP version a Gradle property instead of dropping the JDK 17 matrix leg:
build.gradle— buildscript classpath readscom.android.tools.build:gradle:${agpVersion}gradle.properties—agpVersiondefaults to9.2.1(the JDK-17-compatible version; also what the JDK-17test_apppublish step uses).github/workflows/build.yml— thebuildmatrix setsagpper leg (17 → 9.2.1,21 → 9.3.0) and exportsORG_GRADLE_PROJECT_agpVersion, overriding the default only on the JDK 21 legNet effect: JDK 17 builds/lints/tests on AGP 9.2.1; JDK 21 exercises AGP 9.3.0. No JDK coverage is dropped.
Test plan
Build (JDK 17)green on AGP 9.2.1Build (JDK 21)green on AGP 9.3.0 (lint included)Test Appgreen (JDK 17, default AGP 9.2.1)Closes #438.
Generated by Claude Code