{ Android | Kotlin } Gradle Plugin in 2026 - Preparing for AGP 10.0.0
RyuNen344android app developer
Have you ever experienced a situation where you just wanted to add Kotlin Multiplatform (KMP) support or update to the latest Kotlin, but for some reason, the build fails? Android Gradle Plugin (AGP) 9.0.0 was released in January 2026, and the release of 10.0.0 scheduled for late 2026 is approaching. Now is the best time to clean up your build.gradle in preparation for AGP 10.0.0 and KMP adoption. In AGP 9, `Built-in Kotlin` was introduced, making the migration to avoid dependency on the old Variant API / DSL API even more important. In AGP 10, the opt-out for the old DSL API is scheduled to be removed, requiring Convention Plugins and build logic to be migrated to Public API-based implementations. As KMP adoption progresses, the way we write Android build.gradle and Convention Plugins is reaching a major turning point. `Built-in Kotlin` and `com.android.kotlin.multiplatform.library`, which was introduced in AGP 8.10.0, are prime examples. A particularly confusing aspect is the handling of SourceSets. In the traditional `com.android.library` + KGP setup, Android-specific SourceSets and Variants were implicitly resolved by AGP, and in many cases, when supporting KMP, developers only needed to be mindful of non-Android SourceSets. However, as integration with Kotlin / KMP on the AGP side advances through `com.android.kotlin.multiplatform.library` and Built-in Kotlin, Android must also be treated as one of the KMP targets. Understanding which API and scope to write SourceSets, dependencies, and compilation settings for Android / JVM / iOS / Web / Desktop becomes essential for comprehending build.gradle in AGP 9 and later. In this session, we will unravel the background of the API consolidation that has been underway since AGP 8 from the perspective of the relationship between the Gradle API, Kotlin Gradle Plugin (KGP), and AGP. Based on that, we will demonstrate how to rewrite build.gradle / Convention Plugins that depend on legacy APIs in accordance with the Public APIs of the AGP 9/10 era. Rather than just tracking AGP changes as mere breaking changes, this session aims to help you understand why the design is heading in that direction and enable you to assemble a Gradle configuration for Android builds with KMP support in mind. Topics covered: 1. Reasons why APIs are changing in AGP 8/9/10: Organizing Variant API / DSL API / Internal API 2. How to write build.gradle / Convention Plugins following AGP APIs 3. Relationship between AGP and KGP after Built-in Kotlin 4. Gradle configuration to make Android libraries KMP-ready (Translated by the DroidKaigi Committee)
Intended audience
- Those who are confused by AGP changes - Those who want to make their Android Library KMP-ready - Those who want to write Gradle Plugins for AGP 9/10