Description
Starting with AGP 9.0, the Android Gradle Plugin provides built-in Kotlin compilation support and no longer requires (and actively blocks) the org.jetbrains.kotlin.android plugin. This means BCV's Android task registration never fires, since it hooks into the kotlin-android plugin ID:
https://github.com/Kotlin/binary-compatibility-validator/blob/0.18.1/src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt#L131
private fun configureAndroidPluginForKotlinLibrary(
project: Project,
extension: ApiValidationExtension,
jvmRuntimeClasspath: NamedDomainObjectProvider<Configuration>
) = configurePlugin("kotlin-android", project, extension) {
// ...
}
As a result, apiDump and apiCheck tasks are never created for any Android library module when using AGP 9.x. The check task also does not include any BCV validation.
The migration path is also blocked
The BCV README recommends migrating to the built-in ABI validation in the Kotlin Gradle plugin (kotlin { abiValidation { ... } }). However, this is also not possible with AGP 9.x because:
- KGP's
abiValidation DSL is only available on the KotlinAndroidProjectExtension registered by the kotlin-android plugin.
- AGP 9.x blocks applying
kotlin-android with the error:
The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0.
- The
kotlin {} extension registered by AGP 9.x does not include the abiValidation DSL.
This creates a gap where neither the standalone BCV plugin nor the KGP built-in replacement can provide API validation for Android library projects using AGP 9.x.
Environment
- AGP: 9.0.1
- Kotlin: 2.2.21
- BCV: 0.18.1
- Gradle: 9.3.1
Steps to reproduce
- Create an Android library project using AGP 9.x (no
kotlin-android plugin applied — AGP handles Kotlin natively).
- Apply
org.jetbrains.kotlinx.binary-compatibility-validator version 0.18.1.
- Run
./gradlew apiDump or ./gradlew apiCheck.
- Observe:
Task 'apiDump' not found.
Expected behavior
BCV should detect Android library modules using AGP 9.x's built-in Kotlin and register apiDump/apiCheck tasks for them, or the KGP built-in abiValidation should be usable alongside AGP 9.x.
Description
Starting with AGP 9.0, the Android Gradle Plugin provides built-in Kotlin compilation support and no longer requires (and actively blocks) the
org.jetbrains.kotlin.androidplugin. This means BCV's Android task registration never fires, since it hooks into thekotlin-androidplugin ID:https://github.com/Kotlin/binary-compatibility-validator/blob/0.18.1/src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt#L131
As a result,
apiDumpandapiChecktasks are never created for any Android library module when using AGP 9.x. Thechecktask also does not include any BCV validation.The migration path is also blocked
The BCV README recommends migrating to the built-in ABI validation in the Kotlin Gradle plugin (
kotlin { abiValidation { ... } }). However, this is also not possible with AGP 9.x because:abiValidationDSL is only available on theKotlinAndroidProjectExtensionregistered by thekotlin-androidplugin.kotlin-androidwith the error:kotlin {}extension registered by AGP 9.x does not include theabiValidationDSL.This creates a gap where neither the standalone BCV plugin nor the KGP built-in replacement can provide API validation for Android library projects using AGP 9.x.
Environment
Steps to reproduce
kotlin-androidplugin applied — AGP handles Kotlin natively).org.jetbrains.kotlinx.binary-compatibility-validatorversion 0.18.1../gradlew apiDumpor./gradlew apiCheck.Task 'apiDump' not found.Expected behavior
BCV should detect Android library modules using AGP 9.x's built-in Kotlin and register
apiDump/apiChecktasks for them, or the KGP built-inabiValidationshould be usable alongside AGP 9.x.