Repository navigation
build(android): [AGP New DSL 2] Compile Android modules with AGP's built-in Kotlin - #6654
Draft
runningcode wants to merge 2 commits into
Draft
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
KMP modules can't combine org.jetbrains.kotlin.multiplatform with com.android.library once AGP's built-in Kotlin is on, which the new AGP DSL needs. sentry-compose now uses com.android.kotlin.multiplatform.library. The Kotlin Gradle plugin's ABI validation skips the new Android target, so build-logic dumps it with the same abi-tools and hooks into checkKotlinAbi and updateKotlinAbi. The JDK target, Robolectric and CodeQL conventions learn the new plugin, lint needs com.android.lint, and detekt's test excludes gain the androidHostTest source set. The plugin has no BuildConfig, so the version comes from a generated internal constant and io.sentry.compose.BuildConfig is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The org.jetbrains.kotlin.android plugin can't run with the new AGP DSL, so the Android modules drop it and android.builtInKotlin=false goes away. Built-in Kotlin compiles every component of a module for the single compileOptions target, so Android unit tests now target Java 11 like the main code, and sentry-test-support, whose inline helpers they call, compiles for Java 11 too. KGP doesn't register ABI validation under built-in Kotlin, so the Android ABI dump from build-logic now covers com.android.library modules as well, reading the release classes through the Variant API. It reproduces every existing dump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
📲 Install BuildsAndroid
|
This branch has not been deployed
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.
PR Stack (AGP New DSL 9.x.x)
📜 Description
Compiles the Android modules with AGP's built-in Kotlin and drops
org.jetbrains.kotlin.androidandandroid.builtInKotlin=false.Note
The first commit is a cherry-pick of #6642 (sentry-compose →
com.android.kotlin.multiplatform.library), which built-in Kotlin needs: AGP rejectskotlin.multiplatform+com.android.libraryonce it's on. Review only the second commit. The cherry-pick merges away cleanly once #6642 syncs into 9.x.x.compileOptionstarget, so the convention's JDK 21 target for Android unit tests is gone. JVM and KMP tests still target 21.sentry-test-supporttargets Java 11. It's unpublished and was compiled for 21, butsentry-android-core's tests inline its helpers, and Kotlin can't inline bytecode of a higher target.sentry-android-ndk-outprocset its Kotlin target toJVM_1_8against a Java 11 compile target.kotlin-androidtolerated the mismatch; AGP doesn't.abiValidationorcheckKotlinAbi.AndroidAbiValidation.ktgeneralizes build(compose): [AGP New DSL 1] Move sentry-compose to the KMP Android library plugin #6642's KMP dump task tocom.android.library: it gets the release classes through the Variant API, dumps them withorg.jetbrains.kotlin:abi-tools, and hooks intocheckKotlinAbi,updateKotlinAbiandcheck. It reproduces every existing.apifile byte for byte.test-app-sizesetsenableKotlin = false: it has no Kotlin, and the size measurement shouldn't include the stdlib.The Kotlin module name changes from
<module>_releaseto<module>. That renames the.kotlin_modulefile and the mangled names ofinternalmembers (29 in replay, 2 in navigation3). Nothing outside their own modules references them.💡 Motivation and Context
AGP 10 removes
android.builtInKotlin=false, andorg.jetbrains.kotlin.androidcan't run with the new DSL, which blocks droppingandroid.newDsl=false.💚 How did you test it?
checkon all 13 Android modules andsentry-test-support: tests, lint, detekt and ABI.test-app-size.checkReleaseUnitTestAarMetadatafails insentry-android-coreandsentry-android-navigation, because test dependencyandroidx.core1.19.1 needs AGP 9.1+. Stock 9.x.x fails the same way, and the AGP matrix only assembles the UI tests.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Drop
android.newDsl=falsein the next stack PR.🤖 Generated with Claude Code
#skip-changelog