API compatibility validation is temporarily disabled due to an incompatibility between AGP 9's built-in Kotlin support and the Binary Compatibility Validator (BCV) plugin.
AGP 9 introduced built-in Kotlin compilation support and actively rejects the org.jetbrains.kotlin.android plugin. BCV hooks into that plugin to register its apiCheck/apiDump tasks. Without it, BCV applies silently but registers no tasks — API validation was broken since the AGP 9 upgrade with no visible error.
The intended replacement — Kotlin Gradle Plugin's built-in abiValidation — has the same limitation: it requires KotlinAndroidProjectExtension which AGP 9's built-in Kotlin does not provide.
- Kotlin/binary-compatibility-validator#312 — BCV tasks not registered with AGP 9 (open, no maintainer response)
- KT-81117 — KGP conflicts with AGP 9 built-in Kotlin
- BCV is in maintenance mode, superseded by KGP's
abiValidation(experimental since Kotlin 2.1.20)
| Approach | Status |
|---|---|
android.builtInKotlin=false |
Works but temporary — removed in AGP 10 |
| Manual BCV task registration (OkHttp approach) | KMP-specific, fragile |
| Fork BCV and fix | Maintaining a fork of a deprecated plugin is not worthwhile |
KGP abiValidation |
Requires kotlin-android plugin which AGP 9 rejects |
- Keep the existing
.apifiles as a historical reference of the last validated public API surface - Monitor upstream issues for a fix in BCV, KGP, or AGP
- Re-enable validation when the ecosystem supports AGP 9
Binary compatibility ensures that apps compiled against an older version of the library continue to work when upgraded to a newer version without recompilation. Breaking binary compatibility can cause:
NoSuchMethodErrorat runtimeNoClassDefFoundErrorfor removed classesIncompatibleClassChangeErrorfor changed class hierarchies
Each published module has an api/<module-name>.api file that contains a text dump of its public API:
debugoverlay/api/debugoverlay.api
debugoverlay-core/api/debugoverlay-core.api
debugoverlay-extension-okhttp/api/debugoverlay-extension-okhttp.api
debugoverlay-extension-timber/api/debugoverlay-extension-timber.api
These files are checked into version control. While validation is disabled, they serve as a reference but are not automatically checked against the current code.
Adding new public classes or methods is safe and backward compatible.
Note: Adding new abstract properties/methods to interfaces is a breaking change for
existing implementers (they must implement the new member). However, since DebugOverlay
provides concrete implementations (e.g., DebugOverlayTimberTree for LogSource),
consumers typically don't implement these interfaces directly.
Breaking changes require careful consideration:
-
Deprecation first - Mark as
@DeprecatedwithReplaceWithsuggestion:@Deprecated( message = "Use newMethod() instead", replaceWith = ReplaceWith("newMethod()"), level = DeprecationLevel.WARNING ) public fun oldMethod() { ... } -
Document in CHANGELOG - Note the deprecation and migration path
-
Version bump - Follow semantic versioning:
- Patch (1.0.x): Bug fixes only, no API changes
- Minor (1.x.0): New features, deprecations allowed, no removals
- Major (x.0.0): Breaking changes, removals allowed
-
Removal timeline - Keep deprecated API for at least one minor version before removal
v2.0.0 - Original API
v2.1.0 - Add new API, deprecate old API (WARNING level)
v2.2.0 - Change deprecation to ERROR level
v3.0.0 - Remove deprecated API
Use @InternalDebugOverlayApi annotation to mark APIs that are public in bytecode but not intended for external use:
@InternalDebugOverlayApi
public class SomeInternalHelper { ... }