Android Gradle Plugin DSL/API migration timeline

The Android Gradle Plugin (AGP) is the supported build system for Android applications and includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.

The following section describes the planned evolution of the AGP’s DSL and API. As new APIs are introduced in stable releases, old APIs will be marked as deprecated. Those deprecated APIs will then become unavailable in the next stable release. Below you will find information about upcoming changes in each major AGP release.

AGP 7.0 (~H1 2021)

New Variant APIs are stable, old APIs are deprecated

  • The Variant APIs that were incubating in 4.1 and 4.2 are stable.
  • All of these interfaces are located in the gradle-api artifact.
  • The previous interfaces and classes used in the old Variant API are now deprecated.

AGP 7.1 (~H2 2021)

New DSL interfaces are stable, old ones are deprecated

  • The DSL interfaces that were incubating in 4.1, 4.2 and 7.0 are now stable.
  • All of these interfaces are located in the gradle-api artifact.
  • The previous interfaces and classes used in the DSL are now deprecated.

When writing plugins, it is now recommended to depend on only the gradle-api artifact in order to use only the new interfaces and classes. One small exception here is the plugin classes that will move to gradle-api in 8.0:

Private internal AGP classes still accessible

Private internal classes from AGP, located in other artifacts, are still accessible during compilation of build files, but it is not recommended to use them as they may change in breaking ways at any time.

AGP 8.0 (~H1 2022)

Old APIs are removed

  • All previous interfaces and classes used in the DSL and the old Variant API are deleted.
  • The gradle-api artifact is the only artifact you need to access DSL and variant API interfaces and classes, and should be used when developing plugins.
  • Using Gradle metadata, which offers different dependency graphs for compile and runtime, only gradle-api artifact is available during compilation of build files.

Private internal AGP classes still accessible

It is still possible to manually depend on an artifact that uses private internal classes from AGP on the compilation classpath (for both plugins and build files), but this isn't recommended as access will be removed in 9.0.

AGP 9.0 (~H1 2023)

Access to private internal AGP classes is removed

Dependency on the gradle artifact now hides all internal classes and gives compilation access only to the interfaces and classes available in the gradle-api artifact. This impacts both plugin and build file compilation.

It isn't possible to manually add a dependency to get access to the internal classes.