Skip to content

fix(build): complete the AGP 9 / Gradle 9 migration so the build is green again - #92

Merged
pandeymangg merged 4 commits into
mainfrom
claude/fix-agp9-buildconfig-property
Oct 7, 2026
Merged

pandeymangg merged 4 commits into
mainfrom
claude/fix-agp9-buildconfig-property

Conversation

@mattinannt

@mattinannt mattinannt commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What

main has not built since the AGP 9.4.1 bump (#77): that bump, together with the Gradle 9.8 and Maven publish plugin bumps, merged without a green build. This PR makes the build configure and pass again.

CI that was red on main (head 3397a9e) and is green here:

  • CodeQL Analyze (java-kotlin): the autobuild's ./gradlew clean failed (run).
  • SonarCloud: the instrumented-test job failed at configuration.
  • Dependency Submission: the Gradle dependency graph was not being submitted (run). That workflow is what lets Dependabot raise alerts for Gradle dependencies, so Gradle vulnerability alerts were not being raised while it was red.

Changes

Each commit fixes the next error the build reported:

  1. gradle.properties: remove android.defaults.buildfeatures.buildconfig=true. AGP 9.0 removed it and fails plugin application when it is set. Nothing in the SDK sources references BuildConfig and false is the AGP 9 default, so generated code is unchanged.
  2. android/build.gradle.kts and the root build.gradle.kts: drop org.jetbrains.kotlin.android (Kotlin support is built into AGP 9) and replace org.jetbrains.kotlin.kapt with com.android.legacy-kapt, which the data binding layout needs. legacy-kapt is a separate artifact, so it is registered in gradle/libs.versions.toml on the agp version and in the root plugins {} block with apply false, like com.android.library.
  3. android/build.gradle.kts: fix the script compilation errors from the Gradle 9 / vanniktech 0.37.0 bumps:
    • SonatypeHost no longer exists, so publishToMavenCentral() is used. It defaults to the Central Portal and automatic release stays off, as before.
    • AndroidSingleVariantLibrary takes SourcesJar/JavadocJar instead of booleans. The mapping is unchanged: sources jar yes, no javadoc jar (the Dokka one is attached separately).
    • Removed the deprecated isTestCoverageEnabled; enableAndroidTestCoverage already covers what jacocoAndroidTestReport reads.
    • Replaced the deprecated tasks.registering delegate with tasks.register.

Review notes

  • CI verifies that the build scripts compile and that the instrumented tests and analysis run. It does not run an actual Maven Central publish, so the mavenPublishing {} block is worth a careful look, and a release dry run is worth doing before the next release.
  • The unused kotlin-android entry is still in gradle/libs.versions.toml. It is harmless and left alone to keep this diff focused.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B1EyETCfytcS4FYcPKWzNw

… in AGP 9

AGP 9.0 removed this option and now fails plugin application when it is set
('The option android.defaults.buildfeatures.buildconfig is deprecated... It was
removed in version 9.0'). Since the AGP 9.4.1 bump this breaks every Gradle
invocation outside the main build, including the CodeQL java-kotlin autobuild
and the Dependency Submission workflow that feeds Dependabot alerts.

Nothing in the SDK uses BuildConfig, and the AGP 9 default is already false.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1EyETCfytcS4FYcPKWzNw
@mattinannt
mattinannt requested a review from pandeymangg October 7, 2026 09:43
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b0d53518-2e49-4b1b-b92a-4b13ee210107
📥 Commits

Reviewing files that changed from the base of the PR and between 3397a9e and 81c488b.

📒 Files selected for processing (4)
  • android/build.gradle.kts
  • build.gradle.kts
  • gradle.properties
  • gradle/libs.versions.toml
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

claude added 3 commits October 7, 2026 09:49
AGP 9 no longer allows org.jetbrains.kotlin.android ('no longer required for
Kotlin support since AGP 9.0') and does not support org.jetbrains.kotlin.kapt
with built-in Kotlin. Drop the Kotlin Android plugin and use
com.android.legacy-kapt, which the data binding annotation processor needs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1EyETCfytcS4FYcPKWzNw
legacy-kapt is a separate artifact from the AGP jar, so it needs a version on
the root classpath; register it next to com.android.library (apply false) and
keep it on the agp version.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1EyETCfytcS4FYcPKWzNw
…e 9 / publish plugin bumps

- vanniktech 0.37.0 removed SonatypeHost; publishToMavenCentral() now defaults to
  the Central Portal (automatic release stays off, as before).
- AndroidSingleVariantLibrary takes SourcesJar/JavadocJar instead of booleans;
  the mapping is unchanged (sources jar yes, javadoc jar none - the Dokka one is
  attached separately).
- Drop deprecated isTestCoverageEnabled; enableAndroidTestCoverage already covers
  the instrumented coverage jacocoAndroidTestReport reads.
- Replace the deprecated 'tasks.registering' delegate with tasks.register.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1EyETCfytcS4FYcPKWzNw
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@mattinannt mattinannt changed the title fix(build): remove android.defaults.buildfeatures.buildconfig removed in AGP 9 fix(build): complete the AGP 9 / Gradle 9 migration so the build is green again Oct 7, 2026
@pandeymangg
pandeymangg added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 9d6dbe5 Oct 7, 2026
6 of 7 checks passed
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.

4 participants