Repository navigation
fix(build): complete the AGP 9 / Gradle 9 migration so the build is green again - #92
Conversation
… 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
|
Warning Review limit reachedYou'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. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
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. Comment |
|
|
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
|



What
mainhas 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:Analyze (java-kotlin): the autobuild's./gradlew cleanfailed (run).Changes
Each commit fixes the next error the build reported:
gradle.properties: removeandroid.defaults.buildfeatures.buildconfig=true. AGP 9.0 removed it and fails plugin application when it is set. Nothing in the SDK sources referencesBuildConfigandfalseis the AGP 9 default, so generated code is unchanged.android/build.gradle.ktsand the rootbuild.gradle.kts: droporg.jetbrains.kotlin.android(Kotlin support is built into AGP 9) and replaceorg.jetbrains.kotlin.kaptwithcom.android.legacy-kapt, which the data binding layout needs.legacy-kaptis a separate artifact, so it is registered ingradle/libs.versions.tomlon theagpversion and in the rootplugins {}block withapply false, likecom.android.library.android/build.gradle.kts: fix the script compilation errors from the Gradle 9 / vanniktech 0.37.0 bumps:SonatypeHostno longer exists, sopublishToMavenCentral()is used. It defaults to the Central Portal and automatic release stays off, as before.AndroidSingleVariantLibrarytakesSourcesJar/JavadocJarinstead of booleans. The mapping is unchanged: sources jar yes, no javadoc jar (the Dokka one is attached separately).isTestCoverageEnabled;enableAndroidTestCoveragealready covers whatjacocoAndroidTestReportreads.tasks.registeringdelegate withtasks.register.Review notes
mavenPublishing {}block is worth a careful look, and a release dry run is worth doing before the next release.kotlin-androidentry is still ingradle/libs.versions.toml. It is harmless and left alone to keep this diff focused.🤖 Generated with Claude Code
https://claude.ai/code/session_01B1EyETCfytcS4FYcPKWzNw