Skip to content

Update to Android Gradle Plugin 9.5.1 and Gradle 9.9.1 - #7791

Merged
rvandermeulen merged 3 commits into
mozilla:mainfrom
rvandermeulen:agp-9
Nov 18, 2026
Merged

rvandermeulen merged 3 commits into
mozilla:mainfrom
rvandermeulen:agp-9

Conversation

@rvandermeulen

Copy link
Copy Markdown
Contributor

AGP and Gradle move together: AGP 9.5.1 needs Gradle 9.6 or newer, and Gradle 9.6 removed an internal API that AGP 8 depends on. Both match mozilla-central, as does Kotlin 2.4.21 in its own commit.

Changes that come with it:

  • Update rust-android-gradle to version 0.11.0, its first release that supports AGP 9. It makes the JNI merge tasks depend on cargoBuild itself, so the megazord no longer has to.
  • AGP 9 compiles Kotlin itself, so standalone builds no longer apply the kotlin-android plugin, as mozilla-central builds already did not.
  • Read config from the root project explicitly and read publish.gradle's properties through providers. Gradle 9.9 deprecates both implicit lookups, and they fail in Gradle 10. On the mozilla-central path, the only change is the explicit rootProject.config, which those files already use elsewhere.
  • Remove android.useAndroidX, which is an AGP 9 default.

The last commit removes Gradle configuration that has no effect and replaces the deprecated buildDir with layout.buildDirectory. There is no gradle-plugin or buildSrc directory for detekt and ktlint to scan, and four lib* properties in gradle.properties have no consumer. The detekt block moves off its deprecated DSL, and its source tree now excludes build directories. Detekt never read files there, but Gradle 9 fails a detekt run that shares an invocation with a Kotlin compile, because the tree overlaps the compiler's caches.

It also removes mozilla-central-only configuration that is no longer needed. settings.gradle no longer overrides the build directory of the a-s projects in mozilla-central; the conventions plugin already gives every in-tree project one, so their outputs move to gradle/build/third_party/application-services/... in the objdir, like every other project. It no longer sets gradle.ext.mozconfig, which each mozilla-central build sets before applying it. The mozilla-central arms of calcVersion and calcGroupId are dropped because only standalone builds call them.

Matches mozilla-central. The Kotlin docs build moves with it.
The two move together: AGP 9.5.1 needs Gradle 9.6 or newer, and Gradle 9.6 removed an internal API that AGP 8
depends on. Both match mozilla-central. rust-android-gradle moves to 0.11.0, its first release that supports
AGP 9. It makes the JNI merge tasks depend on cargoBuild itself, so the megazord no longer has to.

AGP 9 compiles Kotlin itself, so standalone builds no longer apply the kotlin-android plugin, as
mozilla-central builds already did not. android.useAndroidX is an AGP 9 default. Gradle 9.9 deprecates two
lookups that fail in Gradle 10: the components now read config from the root project explicitly, and
publish.gradle reads its properties through providers.
buildDir is deprecated in favor of layout.buildDirectory. There is no gradle-plugin or buildSrc directory for
detekt and ktlint to scan, and four lib* properties in gradle.properties have no consumer. The detekt block
moves off its deprecated input, config and xml.enabled properties, and its source tree now excludes build
directories: detekt never read files there, but Gradle 9 fails a detekt run that shares an invocation with a
Kotlin compile, because the tree overlaps the compiler's caches. The detekt task's exclude goes too: it passed
one comma-joined pattern, which matched no file.

Some mozilla-central-only configuration goes too. settings.gradle no longer overrides the build directory of
the a-s projects there: mozilla-central's conventions plugin already gives every project one, which now
applies to them as well. It also no longer sets gradle.ext.mozconfig, which every mozilla-central build sets
before applying it. The mozilla-central arms of calcVersion and calcGroupId are unreachable, since only
standalone builds call them, and the root build.gradle, which mozilla-central does not use, no longer checks
for mozconfig before applying maven-publish.
@rvandermeulen

Copy link
Copy Markdown
Contributor Author

/taskcluster ci full

@rvandermeulen
rvandermeulen marked this pull request as ready for review November 17, 2026 01:23

@bendk bendk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look fine to me, thanks for upgrading this.

@rvandermeulen
rvandermeulen added this pull request to the merge queue Nov 18, 2026
Merged via the queue into mozilla:main with commit af1ea21 Nov 18, 2026
63 checks passed
@rvandermeulen
rvandermeulen deleted the agp-9 branch November 18, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants