Skip to content

build: AGP 8.13.2 + R8 9.1.43, and drop Gradle syntax deprecated for 9.0/10.0 - #2050

Merged
edusperoni merged 2 commits into
mainfrom
chore/build-tooling-warnings
Sep 22, 2026
Merged

edusperoni merged 2 commits into
mainfrom
chore/build-tooling-warnings

Conversation

@edusperoni

@edusperoni edusperoni commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Kotlin-metadata warnings from D8

Every CI build logs ~1000 lines of

WARNING: D8: An error occurred when parsing kotlin metadata. This normally happens when using a newer version of kotlin than the kotlin version released when this version of R8 was created.
WARNING: D8: Unexpected error during rewriting of Kotlin metadata for class 'kotlin.text.StringsKt__StringBuilderJVMKt':

during mergeExtDexDebug. f36b01c moved Kotlin to 2.4.10 while AGP stayed on 8.12.1, whose bundled R8 (8.12.14) predates Kotlin 2.4 metadata. Per Google's AGP/D8/R8 requirements for Kotlin, Kotlin 2.4 needs R8 9.1.29+, and no 8.x AGP bundles that (8.13.2 ships 8.13.19, which only knows 2.3). AGP 9.x would, but it requires Gradle 9.6, built-in Kotlin and the removal of the legacy variant API, which the shipped app/build.gradle and NativeScript plugins rely on; that is a separate migration.

So this PR:

  • bumps AGP to 8.13.2 (last 8.x), and
  • pins com.android.tools:r8:9.1.43 on the buildscript classpath, the override mechanism the same doc describes.

Both are NS_DEFAULT_* properties in gradle.properties and overridable per project (-Pr8Version=..., like -PandroidBuildToolsVersion). Since gradle.properties and build.gradle ship in the npm package, every app build picks this up.

Measured locally on :app:mergeExtDexDebug --rerun-tasks:

Config Kotlin-metadata warnings
AGP 8.12.1 (main) 964
AGP 8.13.2 964
AGP 8.13.2 + R8 9.1.43 0

Gradle deprecation notices

CI on Gradle 8.14.3 reports three kinds of deprecation; all are fixed so --warning-mode all is clean:

  1. Groovy space-assignment (namespace "x"namespace = "x", removed in Gradle 10): the reported sites in runtime/build.gradle, app/build.gradle, BuildToolTask.gradle, plus the same pattern at ignoreExitValue, the root build.gradle task description, and mainmainClass on the SBG JavaExec.
  2. Gradle.useLogger (removed in 9.0): CustomExecutionLogger.gradle is now a BuildService implementing OperationCompletionListener. It records TaskFailureResults and prints the same styled failure summary from close(), still skipping BuildToolTask failures (those log their own errors). StyledTextOutputFactory cannot be injected into a build service, so the script hands the output over in taskGraph.whenReady; that makes it not configuration-cache compatible, which it wasn't before either.
  3. -b <file> custom build file (removed in 9.0): the jsparser spec now runs gradlew -p static-binding-generator, whose settings.gradle sets rootProject.buildFileName = 'runtests.gradle'. That settings file is only read for standalone runs; as a test-app subproject nothing changes.

Verified: ./gradlew :app:help :runtime:help --warning-mode all goes from 10 deprecation lines to 0 (the one remaining warning is KGP saying Gradle 8.14.3 itself is deprecated), runSbgTests passes 8/8, and a forced task failure prints the styled summary exactly once.

Not in this PR

Deprecations that only fire on code paths CI's help-style runs don't exercise, left for a follow-up since they need ExecOperations/design choices:

  • Task.project at execution time in cleanupAllJars (app/build.gradle:641, error in Gradle 10).
  • project.exec {} inside doFirst/doLast (runtime/build.gradle:322,328, root build.gradle:75; removed in Gradle 9).
  • The root build.gradle's runTests still invokes -b runtests.gradle in test-app/, which has its own settings, so the buildFileName trick doesn't apply there.

Summary by CodeRabbit

  • Chores

    • Updated build configuration syntax across multiple scripts for consistency.
    • Adjusted project setup so standalone builds use the intended build file and launch settings.
    • Updated default Android build tool and related version settings.
  • Bug Fixes

    • Improved build failure reporting so task errors are collected and shown more reliably.
    • Updated build execution setup to work with the latest Gradle and Android toolchain changes.

- Assign DSL properties with `prop = value` instead of the Groovy
  space-assignment form (namespace, ndkVersion, cmake version/path,
  signingConfig, description, standardOutput/errorOutput,
  ignoreExitValue).
- Replace the gradle.useLogger() failure logger with a BuildService
  listening for task completion events; it prints the same styled
  failure summary at the end of the build and still skips failures of
  BuildToolTask tasks, which log their own errors.
- Run the SBG AST test builds with `-p` instead of `-b`: the
  static-binding-generator settings.gradle now selects runtests.gradle
  as its build file, and runtests.gradle uses mainClass instead of main.
The Kotlin version moved to 2.4.10 while AGP stayed on 8.12.1, whose bundled
R8 (8.12.14) predates Kotlin 2.4 metadata. Every dex step then logs
"An error occurred when parsing kotlin metadata" once per Kotlin stdlib class,
about a thousand lines per build. Kotlin 2.4 needs R8 9.1.29 or newer, which
no 8.x AGP bundles, so R8 is pinned on the buildscript classpath the way the
AGP/Kotlin compatibility docs describe, and AGP moves to the last 8.x release.
Both are overridable per project like the existing versions.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e35c686b-45d3-4d40-accf-038aef6fb43a

📥 Commits

Reviewing files that changed from the base of the PR and between 1e7fc7a and 31c2931.

📒 Files selected for processing (10)
  • build.gradle
  • test-app/app/build.gradle
  • test-app/app/gradle-helpers/BuildToolTask.gradle
  • test-app/app/gradle-helpers/CustomExecutionLogger.gradle
  • test-app/build-tools/jsparser/tests/specs/ast-parser-tests.spec.js
  • test-app/build-tools/static-binding-generator/runtests.gradle
  • test-app/build-tools/static-binding-generator/settings.gradle
  • test-app/build.gradle
  • test-app/gradle.properties
  • test-app/runtime/build.gradle

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

This PR updates Gradle build configuration for compatibility with newer tooling. It adds explicit R8 setup, makes the static-binding-generator tests run as a standalone Gradle project, replaces custom task failure logging with a build service, fixes one task output assignment, and normalizes several Gradle property assignments.

Changes

Gradle compatibility and tooling

Layer / File(s) Summary
Toolchain and standalone build setup
test-app/gradle.properties, test-app/build.gradle, test-app/build-tools/static-binding-generator/settings.gradle, test-app/build-tools/static-binding-generator/runtests.gradle, test-app/build-tools/jsparser/tests/specs/ast-parser-tests.spec.js
test-app now defines a default NS_DEFAULT_R8_VERSION, adds com.android.tools:r8 to the buildscript classpath, and updates the default Android build tools version. The static-binding-generator directory now has standalone settings.gradle wiring, runSbg uses mainClass, and the JS parser tests invoke Gradle with -p against that project directory.
Build failure logging service
test-app/app/gradle-helpers/BuildToolTask.gradle, test-app/app/gradle-helpers/CustomExecutionLogger.gradle
BuildToolTask.setOutputs now uses explicit assignment for standardOutput and errorOutput. CustomExecutionLogger changes from a BuildAdapter/TaskExecutionListener to a shared BuildService that listens for task completion events, collects multiple task failures, skips self-reporting BuildToolTask paths, and prints failures in close().
Gradle DSL assignment normalization
build.gradle, test-app/app/build.gradle, test-app/runtime/build.gradle
Several Gradle DSL properties now use explicit = assignment, including description, namespace, signingConfig, ndkVersion, cmake.version, cmake.path, and ignoreExitValue. The assigned values stay the same in these edits.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 31c29

The tooling updates have no established remaining compatibility or build-failure-reporting issue, so no actionable merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (9 skipped: 9 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both main changes: updating AGP and R8, and removing deprecated Gradle syntax.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (9 skipped: 9 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Rabbit boots the build at dawn,
New paths are set and old forms gone.
A logger listens, calm and bright,
And gathers failures through the night.
R8 hops in with careful feet,
Till Gradle taps a steadier beat.

Comment @coderabbitai help to get the list of available commands.

@edusperoni
edusperoni merged commit b6f5f7c into main Sep 22, 2026
8 checks passed
@edusperoni
edusperoni deleted the chore/build-tooling-warnings branch September 22, 2026 22:56
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.

1 participant