This page contains release notes for preview releases of the Android Gradle plugin (AGP).

## Android Gradle plugin 9.0

Android Gradle plugin 9.0 is a new major release of AGP, and brings API and behavior changes.

To update to Android Gradle plugin 9.0.0-beta03, use the[Android Gradle plugin Upgrade Assistant](https://developer.android.com/build/agp-upgrade-assistant)in Android Studio Otter 3 Feature Drop \| 2025.2.3.

The AGP upgrade assistant helps preserve existing behaviors when upgrading your project when appropriate, allowing you to upgrade your project to use AGP 9.0, even if you're not ready to adopt all the new defaults in AGP 9.0.

### Compatibility

The maximum Android API level that Android Gradle plugin 9.0.0-beta03 supports is API level 36.

Android Gradle plugin 9.0.0-beta03 requires[Gradle 9.0.0](https://docs.gradle.org/9.0.0/release-notes.html).

<br />

|                 | Minimum version | Default version |                                                                                                        Notes                                                                                                        |
|----------------:|:---------------:|:---------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|          Gradle |      9.1.0      |      9.1.0      |                                       To learn more, see[updating Gradle](https://developer.android.com/build/releases/gradle-plugin?buildsystem=ndk-build#updating-gradle).                                        |
| SDK Build Tools |     36.0.0      |     36.0.0      |                           [Install](https://developer.android.com/studio/intro/update#sdk-manager)or[configure](https://developer.android.com/tools/releases/build-tools)SDK Build Tools.                           |
|             NDK |       N/A       |  28.2.13676358  | [Install](https://developer.android.com/studio/projects/install-ndk#specific-version)or[configure](https://developer.android.com/studio/projects/install-ndk#apply-specific-version)a different version of the NDK. |
|             JDK |       17        |       17        |                                                     To learn more, see[setting the JDK version](https://developer.android.com/studio/intro/studio-config#jdk).                                                      |

<br />

### The`android`DSL classes now only implement the new public interfaces

Over the last several years, we have introduced[new interfaces](https://developer.android.com/reference/tools/gradle-api)for our DSL and API in order to better control which APIs are public. AGP versions 7.x and 8.x still used the old DSL types (for example`BaseExtension`) which also implemented the new public interfaces, in order to maintain compatibility as work progressed on the interfaces.

AGP 9.0 uses our new DSL interfaces exclusively, and the implementations have changed to new types that are fully hidden. This also removes access to the old, deprecated variant API.

To update to AGP 9.0, you might need to do the following:

- **Ensure your project is compatible with[built-in Kotlin](https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin):** The`org.jetbrains.kotlin.android`plugin is not compatible with the new DSL.
- **Switch KMP projects to the[Android Gradle Library Plugin for KMP](https://developer.android.com/kotlin/multiplatform/plugin):** Using the`org.jetbrains.kotlin.multiplatform`plugin in the same Gradle subproject as the`com.android.library`and`com.android.application`plugins is not compatible with the new DSL.

  | **Note:** The new KMP integration does not support using KMP and the Android Application plugin in the same Gradle subproject. To migrate, extract your Android app to a separate subproject.
- **Update your build files:** While the change of interfaces is meant to keep the DSL as similar as possible, there might be[some small changes](https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-changed-dsl).

- **Update your custom build logic to reference the new DSL and API:** Replace any references to the internal DSL with the public DSL interfaces. In most cases this will be a one-to-one replacement. Replace any use of the`applicationVariants`and similar APIs with the new[`androidComponents`API](https://developer.android.com/build/extend-agp#variant-api-artifacts-tasks). This might be more complex, as the`androidComponents`API is designed to be more stable to keep plugins compatible longer. Check our[Gradle Recipes](https://github.com/android/gradle-recipes/tree/agp-9.0)for examples.

- **Update third-party plugins:**Some third-party plugins might still depend on interfaces or APIs that are no longer exposed. Migrate to versions of those plugins which are compatible with AGP 9.0.

The switch to the new DSL interfaces prevents plugins and Gradle build scripts using various deprecated APIs, including:

|                                                                          Deprecated API in the`android`block                                                                           |                                                                                           Function                                                                                            |                                                                                                                                                                                                                                                                                          Replacement                                                                                                                                                                                                                                                                                          |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| `applicationVariants`, `libraryVariants`, `testVariants`, and `unitTestVariants`                                                                                                       | Extension points for plugins to add new functionality to AGP.                                                                                                                                 | Replace this with the[`androidComponents.onVariants`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1))API, for example: ```kotlin androidComponents { onVariants() { variant -> variant.signingConfig .enableV1Signing.set(false) } } ``` There might not be a direct replacement for all previous APIs.[File an issue](https://developer.android.com/studio/report-bugs)if there is a use case that is not covered by the new variant APIs. |
| `variantFilter`                                                                                                                                                                        | Allows selected variants to be disabled.                                                                                                                                                      | Replace this with the[`androidComponents.beforeVariants`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)))API, for example: ```kotlin androidComponents { beforeVariants( selector() .withBuildType("debug") .withFlavor("color", "blue") ) { variantBuilder -> variantBuilder.enable = false } } ```                                                                                                                                   |
| `deviceProvider`and `testServer`                                                                                                                                                       | Registration of custom test environments for running tests against Android devices and emulators.                                                                                             | Switch to[Gradle-managed devices](https://developer.android.com/studio/test/gradle-managed-devices).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `sdkDirectory`, `ndkDirectory`, `bootClasspath`, `adbExecutable`, and `adbExe`                                                                                                         | Using various components of the Android SDK for custom tasks.                                                                                                                                 | Switch to[`androidComponents.sdkComponents`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/SdkComponents).                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `registerArtifactType`, `registerBuildTypeSourceProvider`, `registerProductFlavorSourceProvider`, `registerJavaArtifact`, `registerMultiFlavorSourceProvider`, and `wrapJavaSourceSet` | Obsolete functionality mostly related to the handling of generated sources in Android Studio, which stopped working in AGP 7.2.0.                                                             | There is no direct replacement for these APIs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `dexOptions`                                                                                                                                                                           | Obsolete settings related to the`dx`tool, which has been replaced by[`d8`](https://developer.android.com/tools/d8). None of the settings have had any effect since Android Gradle plugin 7.0. | There is no direct replacement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `generatePureSplits`                                                                                                                                                                   | Generate configuration splits for instant apps.                                                                                                                                               | The ability to ship configuration splits is now built in to Android app bundles.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `aidlPackagedList`                                                                                                                                                                     | AIDL files to package in the AAR to expose it as API for libraries and apps that depend on this library.                                                                                      | This is still exposed on[`LibraryExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/LibraryExtension)but not on the other extension types.                                                                                                                                                                                                                                                                                                                                                                                                    |

If you update to AGP 9.0 and see the following error message, it means that your project is still referencing some of the old types:  

    java.lang.ClassCastException: class com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated_Decorated
    cannot be cast to class com.android.build.gradle.BaseExtension

If you are blocked by incompatible third-party plugins, you can opt out and get back the old implementations for the DSL, as well as the old variant API. While doing this, the new interfaces are also available, and you can still update your own build logic to the new API. To opt out, include this line in your`gradle.properties`file:  

    android.newDsl=false

| **Caution:** The ability to opt-out will be removed in AGP 10.0 (mid-2026).

You can also start upgrading to the new APIs before upgrading to AGP 9.0. The new interfaces have been present for many AGP versions and so you can have a mix of new and old. The[AGP API reference docs](https://developer.android.com/reference/tools/gradle-api)show the API surface for each AGP version, and when each class, method and field was added.

During the 9.0 alpha phase we're reaching out to plugin authors to help them adapt and release plugins that are fully compatible with the new modes, and will enhance the AGP Upgrade Assistant in Android Studio to guide you through the migration.

If you find that the new DSL or Variant API are missing capabilities or features, please file an[issue](https://issuetracker.google.com/issues/new?component=192708&template=840533)as soon as possible.

### Built-in Kotlin

Android Gradle plugin 9.0 introduces built-in Kotlin support and enables it by default. That means you no longer have to apply the`org.jetbrains.kotlin.android`(or`kotlin-android`) plugin in your build files to compile Kotlin source files. This simplifies the Kotlin integration with AGP, avoids the use of the deprecated APIs, and improves performance in some cases.

Therefore, when you upgrade your project to AGP 9.0, you need to also[migrate to built-in Kotlin](https://developer.android.com/build/migrate-to-built-in-kotlin)or[opt out](https://developer.android.com/build/migrate-to-built-in-kotlin#opt-out-of-built-in-kotlin).

You can[selectively disable built-in Kotlin support](https://developer.android.com/build/migrate-to-built-in-kotlin#selectively-disable)for Gradle subprojects that don't have Kotlin sources.

### Runtime dependency on Kotlin Gradle plugin 2.2.10

Android Gradle plugin 9.0 has a runtime dependency on Kotlin Gradle plugin (KGP) 2.2.10, which is the minimum version required for[built-in Kotlin support](https://developer.android.com/build/migrate-to-built-in-kotlin).

That means if you opt of built-in Kotlin and use a KGP version lower than 2.2.10, Gradle will upgrade the KGP version to 2.2.10 automatically.

Likewise, if you're using a KSP version lower than 2.2.10-2.0.2, AGP will upgrade the KSP version to 2.2.10-2.0.2 to match the KGP version.

Therefore, if you opt out of built-in Kotlin and want to use an older version of KGP or KSP, you need to add the following to your top-level build file:  

    buildscript {
        dependencies {
            classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") {
                version { strictly("<var class="readonly" translate="no">KGP_VERSION</var>") }
            }
            classpath("com.google.devtoolsksp:symbol-processing-gradle-plugin") {
                version { strictly("<var class="readonly" translate="no">KSP_VERSION</var>") }
            }
        }
    }

| **Note:** The minimum KGP version you can downgrade to is 2.0.0 because Gradle 9.0.0 requires[KGP version 2.0.0 or higher](https://docs.gradle.org/current/userguide/upgrading_major_version_9.html#lowest_supported_kotlin_gradle_plugin_version_change).
| **Caution:** If you downgrade the KGP version, your project might not be compatible with future minor releases of AGP 9. Also, you might not be able to downgrade KGP if your project has test fixtures.

### IDE support for test fixtures

AGP 9.0 brings full Android Studio IDE support for[test fixtures](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/TestFixtures). To have this support, use AGP 9.0.0-alpha07 or higher.

### Behavior changes

Android Gradle plugin 9.0 has the following new behaviors:

|                                                      Behavior                                                       |                                                                                                                                                          Recommendation                                                                                                                                                           |
|---------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Android Gradle plugin 9.0 uses NDK version`r28c`by default.                                                         | Consider specifying the NDK version you want to use explicitly.                                                                                                                                                                                                                                                                   |
| Android Gradle plugin 9.0 by default requires consumers of a library to use the same or higher compile SDK version. | Use the same or higher compile SDK when consuming a library. If this is not possible, or you want to give consumers of a library you publish more time to switch, set[`AarMetadata.minCompileSdk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/AarMetadata#minCompileSdk())explicitly. |

AGP 9.0 includes updates to the following Gradle properties' defaults. This gives you the choice to preserve the AGP 8.13 behavior when upgrading:

|                           Property                           |                                                                                                                                                                                                                                                                                                                                           Function                                                                                                                                                                                                                                                                                                                                           | Change from AGP 8.13 to AGP 9.0 |                                                                                                                                                                      Recommendation                                                                                                                                                                       |
|--------------------------------------------------------------| |---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `android.``newDsl`                                           | Use the new DSL interfaces, without exposing the legacy implementations of the`android`block. This also means the legacy variant API, such as`android.applicationVariants`is no longer accessible.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | `false`→`true`                  | You can opt out by setting`android.newDsl=false`. Once all plugins and build logic your project uses are compatible, remove the opt out.                                                                                                                                                                                                                  |
| `android.``builtInKotlin`                                    | Enables[built-in Kotlin](https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | `false`→`true`                  | [Migrate to built-in Kotlin](https://developer.android.com/build/migrate-to-built-in-kotlin)if you can or[opt out](https://developer.android.com/build/migrate-to-built-in-kotlin#opt-out-of-built-in-kotlin).                                                                                                                                            |
| `android.``uniquePackage``Names`                             | Enforces that each library has a distinct package name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `false`→`true`                  | Specify unique package names for all libraries within your project. If that is not possible, you can disable this flag while you migrate.                                                                                                                                                                                                                 |
| `android.``useAndroidx`                                      | Use[`androidx`](https://developer.android.com/jetpack/androidx)dependencies by default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `false`→`true`                  | Adopt[`androidx`](https://developer.android.com/jetpack/androidx/migrate)dependencies.                                                                                                                                                                                                                                                                    |
| `android.``default.``androidx.``test.``runner`               | Run on-device tests with the[`androidx.test.runner.AndroidJUnitRunner`](https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner)class by default, replacing the default of the deprecated[`InstrumentationTestRunner`](https://developer.android.com/reference/android/test/InstrumentationTestRunner)for ```text android { defaultConfig { testInstrumentationRunner = "..." } } ```                                                                                                                                                                                                                                                               | `false`→`true`                  | Adopt[`AndroidJUnitRunner`](https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner), or specify your custom`testInstrumentationRunner`explicitly.                                                                                                                                                               |
| `android.``dependency.``useConstraints`                      | Controls the use of dependency constraints between configurations. The default in AGP 9.0 is`false`which only uses constraints in application device tests (AndroidTest). Setting this to`true`will revert back to the 8.13 behavior.                                                                                                                                                                                                                                                                                                                                                                                                                                                        | `true`→`false`                  | Don't use dependency constraints everywhere unless you need them. Accepting the new default of this flag also enables optimizations in the project import process which should reduce the import time for builds with many Android library subprojects.                                                                                                   |
| `android.``enableApp``CompileTime``RClass`                   | Compile code in applications against a non-final R class, bringing application compilation in line with library compilation. This improves incrementality and paves the way for future performance optimizations to the resource processing flow.                                                                                                                                                                                                                                                                                                                                                                                                                                            | `false`→`true`                  | Many projects can just adopt the new behavior with no source changes. If the R class fields are used anywhere that requires a constant, such as switch cases, refactor to use chained if statements.                                                                                                                                                      |
| `android.``sdk.``defaultTargetSdk``ToCompileSdk``IfUnset`    | Uses the compile SDK version as the default value for the target SDK version in apps and tests. Before this change, the target SDK version would default to the min SDK version.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | `false`→`true`                  | Specify the target SDK version explicitly for apps and tests.                                                                                                                                                                                                                                                                                             |
| `android.``onlyEnableUnitTest``ForTheTested``BuildType`      | Only creates unit test components for the tested build type. In the default project this results in a single unit test for debug, where the previous behavor was to have unit tests run for debug or release.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | `false`→`true`                  | If your project doesn't require tests to run for both debug and release, no change is required.                                                                                                                                                                                                                                                           |
| `android.``proguard.``failOnMissingFiles`                    | Fails the build with an error if any of the keep files specified in the AGP DSL don't exist on disk. Before this change typos in filenames would result in files being silently ignored.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | `false`→`true`                  | Remove any invalid proguard files declarations                                                                                                                                                                                                                                                                                                            |
| `android.``r8.``optimizedResourceShrinking`                  | Allows R8 to keep fewer Android resources by considering classes and Android resources together.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | `false`→`true`                  | If your project's keep rules are already complete, no change is required.                                                                                                                                                                                                                                                                                 |
| `android.``r8.``strictFullMode``ForKeepRules`                | Allows R8 to keep less by not implicitly keeping the default constructor when a class is kept. That is,`-keep class A`no longer implies`-keep class A { <init>(); }`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | `false`→`true`                  | If your project's keep rules are already complete, no change is required. Replace`-keep class A`with`-keep class A { <init>(); }`in your project's keep rules for any cases where you need the default constructor to be kept.                                                                                                                            |
| `android.``defaults.``buildfeatures.``resvalues`             | Enables[`resValues`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/HasAndroidResources#resValues())in all subprojects                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | `true`→`false`                  | Enable`resValues`in only the subprojects that need it by setting the following in those projects' Gradle build files: ```text android { buildFeatures { resValues = true } } ```                                                                                                                                                                          |
| `android.``defaults.``buildfeatures.``shaders`               | Enables[shader compilation](https://developer.android.com/ndk/guides/graphics/shader-compilers)in all subprojects                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `true`→`false`                  | Enable shader compilation in only the subprojects that contain shaders to be compiled by setting the following in those projects' Gradle build files: ```text android { buildFeatures { shaders = true } } ```                                                                                                                                            |
| `android.``r8.``proguardAndroidTxt.``disallowed`             | In AGP 9.0,`getDefaultProguardFile()`will only support`proguard-android-optimize.txt`rather than`proguard-android.txt`. This is to prevent accidental usage of the`­dontoptimize`flag, which is included in`proguard-android.txt`.                                                                                                                                                                                                                                                                                                                                                                                                                                                           | `false`→`true`                  | You can explicitly specify`­dontoptimize`in a custom proguardFile if you want to avoid optimization, alongside using`proguard-android-optimize.txt`. Make sure to remove the`­dontoptimize`flag from this file if possible, as it reduces R8 optimization benefits. If not, opt out by setting`android.r8.globalOptionsInConsumerRules.disallowed=false`. |
| `android.``r8.``globalOptions``InConsumerRules.``disallowed` | From AGP 9.0, Android library and feature module publishing will fail if consumer keep files contain problematic Proguard configurations. Consumer keep files that include global options like`­dontoptimize`or`­dontobfuscate`should only be used in application modules, and can reduce optimization benefits for library users. Android App module compilation will silently ignore any such global options if embedded in a pre-compiled dependency (JAR or AAR). You can see when this occurs by checking configuration.txt (typically in a path like`<app_module>/build/outputs/mapping/<build_variant>/configuration.txt`) for comments like:`# REMOVED CONSUMER RULE: ­dontoptimize` | `false`→`true`                  | Published libraries should remove any incompatible rules. Internal libraries should move any incompatible but required rules to a proguardFile in an app module instead. Opt out by setting`android.r8.globalOptionsInConsumerRules.disallowed=false`. Once all your consumer keep files are compatible, remove the opt out.                              |
| `android.``sourceset.``disallowProvider`                     | Disallow passing providers for generated sources using the[`AndroidSourceSet`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/AndroidSourceSet)DSL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | `false`→`true`                  | Use the[`Sources`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/Sources)API on`androidComponents`to register generated sources.                                                                                                                                                                             |
| `android.``custom.``shader.``path.``required`                | Requires the shader compiler path to be explicitly set in`local.properties`if shader compilation is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | `false`→`true`                  | Add`glslc.dir=/path/to/shader-tools`to your project's`local.properties`.                                                                                                                                                                                                                                                                                  |

### Removed features

Android Gradle plugin 9.0 removes the following functionality:

- **Embedded Wear OS app support**  
  AGP 9.0 removes support for embedding Wear OS apps, which is no longer supported in Play. This includes removing the`wearApp`configurations and the[`AndroidSourceSet.wearAppConfigurationName`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#wearAppConfigurationName())DSL. See[Distribute to Wear OS](https://developer.android.com/distribute/best-practices/launch/distribute-wear)for how to publish your app to Wear OS.
- **`androidDependencies`and`sourceSets`report task**
- **Density split APK support**   
  AGP 9.0 removes support for creating split APKs based on screen density. The functionality and the related APIs have been removed. To split APKs based on screen density using AGP 9.0 or higher, use[app bundles](https://developer.android.com/guide/app-bundle).

### Changed DSL

Android Gradle plugin 9.0 has the following breaking DSL changes:

- The parameterization of[`CommonExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/CommonExtension)has been removed.

  In itself, this is only a source-level breaking change to help avoid future source-level breaking changes, but it also means that the block methods need to move from[`CommonExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/CommonExtension)to[`ApplicationExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/ApplicationExtension),[`LibraryExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/LibraryExtension),[`DynamicFeatureExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/DynamicFeatureExtension)and[`TestExtension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/TestExtension).

  When upgrading your project to AGP 9.0, refactor Gradle plugin code which uses those parameters or the block methods. For example the following plugin is updated to remove the type parameter and not rely on the removed block methods:

  **AGP 8.13**  

      val commonExtension: CommonExtension<*, *, *, *, *, *> =
              extensions.getByType(CommonExtension::class)
      commonExtension.apply {
          defaultConfig {
              minSdk {
                  version = release(28)
              }
          }
      }

  **AGP 9.0**  

      val commonExtension: CommonExtension =
              extensions.getByType(CommonExtension::class)
      commonExtension.apply {
          defaultConfig.apply {
              minSdk {
                  version = release(28)
              }
          }
      }

  For plugins which target a range of AGP versions, using the getter directly is binary compatible with AGP versions lower than 9.0.

### Removed DSL

Android Gradle plugin 9.0 removes:

- [`AndroidSourceSet.jni`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#jni(kotlin.Function1)), because it was not functional.

- [`AndroidSourceSet.wearAppConfigurationName`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#wearAppConfigurationName()), as it relates to the removed embedded Wear OS app support.

- [`BuildType.isRenderscriptDebuggable`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/BuildType#isRenderscriptDebuggable()), because it was not functional.

- [`DependencyVariantSelection`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/DependencyVariantSelection). It is replaced By[`DependencySelection`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/DependencySelection), which is exposed as[`kotlin.android.localDependencySelection`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#localDependencySelection(kotlin.Function1))

- [`Installation.installOptions(String)`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Installation#installOptions(kotlin.String)). It is replaced by the mutable property of[`Installation.installOptions`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/Installation#installOptions()).

- The experimental, but never stabilized[`PostProcessing`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/PostProcessing)block.

- [`ProductFlavor.setDimension`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/ProductFlavor#setDimension(kotlin.String)), which is replaced by the[`dimension`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/ProductFlavor#dimension())property

- `LanguageSplitOptions`, which was only useful for[Google Play Instant](https://developer.android.com/topic/google-play-instant), which is deprecated.

- [`DensitySplit`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/DensitySplit), because the feature is no longer supported. Replacement is to use[App Bundles](https://developer.android.com/guide/app-bundle).

### Removed APIs

Android Gradle plugin 9.0 removes:

- [`AndroidComponentsExtension.finalizeDSl`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/AndroidComponentsExtension#finalizeDSl(org.gradle.api.Action)). It is replaced by[`finalizeDsl`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/DslLifecycle#finalizeDsl(kotlin.Function1))

- [`Component.transformClassesWith`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Component#transformClassesWith(java.lang.Class,com.android.build.api.instrumentation.InstrumentationScope,kotlin.Function1)). It is replaced by[`Instrumentation.transformClassesWith`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/Instrumentation#transformClassesWith(java.lang.Class,com.android.build.api.instrumentation.InstrumentationScope,kotlin.Function1))

- [`Component.setAsmFramesComputationMode`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Component#setAsmFramesComputationMode(com.android.build.api.instrumentation.FramesComputationMode)). It is replaced by[`Instrumentation.setAsmFramesComputationMode`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Instrumentation#setAsmFramesComputationMode(com.android.build.api.instrumentation.FramesComputationMode))

- [`ComponentBuilder.enabled`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/ComponentBuilder#enabled()). It is replaced by[`ComponentBuilder.enable`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/ComponentBuilder#enable()).

- [`DependenciesInfoBuilder.includedInApk`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/DependenciesInfoBuilder#includedInApk()). Is is replaced by[`includeInApk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/DependenciesInfoBuilder#includeInApk())

- [`DependenciesInfoBuilder.includedInBundle`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/DependenciesInfoBuilder#includedInBundle()). Is is replaced by[`includeInBundle`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/DependenciesInfoBuilder#includeInBundle())

- [`GeneratesApk.targetSdkVersion`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/GeneratesApk#targetSdkVersion()). Is is replaced by[`targetSdk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/GeneratesApk#targetSdk())

- [`Variant.minSdkVersion`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Variant#minSdkVersion()). Is is replaced by[`minSdk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/Variant#minSdk())

- [`Variant.maxSdkVersion`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Variant#maxSdkVersion()). Is is replaced by[`maxSdk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/Variant#maxSdk())

- [`Variant.targetSdkVersion`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Variant#targetSdkVersion()). Is is replaced by[`targetSdk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/Variant#targetSdk())

- [`Variant.unitTest`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Variant#unitTest()), as it was not applicable to the[`com.android.test`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/gradle/TestPlugin)plugin.`unitTest`is available on[`VariantBuilder`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/VariantBuilder)subtypes extending[`HasUnitTest`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/HasUnitTest).

- [`VariantBuilder.targetSdk`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/VariantBuilder#targetSdk())and[`targetSdkPreview`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/VariantBuilder#targetSdkPreview()), as they were not meaningful in libraries. Use[`GeneratesApkBuilder.targetSdk`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/GeneratesApkBuilder#targetSdk())or[`GeneratesApkBuilder.targetSdkPreview`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/GeneratesApkBuilder#targetSdkPreview())instead.

- [`VariantBuilder.enableUnitTest`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/VariantBuilder#enableUnitTest()), as it was not applicable to the[`com.android.test`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/gradle/TestPlugin)plugin.`enableUnitTest`is available on[`VariantBuilder`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/VariantBuilder)subtypes extending[`HasUnitTestBuilder`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/HasUnitTestBuilder).

- [`VariantBuilder.unitTestEnabled`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/VariantBuilder#unitTestEnabled())is removed in favor of the more consistently named[`enableUnitTest`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/HasUnitTestBuilder#enableUnitTest())on the[`VariantBuilder`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/VariantBuilder)subtypes extending[`HasUnitTestBuilder`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/HasUnitTestBuilder).

- [`VariantOutput.enable`](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/VariantOutput#enable()). Is is replaced by[`enabled`](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/variant/VariantOutput#enabled())

- The deprecated and disabled`FeaturePlugin`and`FeatureExtension`.

- The deprecated and disabled`BaseExtension.registerTransform`APIs, which only remained to allow compiling against the latest AGP version while targeting running on AGP 4.2 or lower.

### Removed Gradle properties

The following Gradle properties were initially added as ways to globally disable features that were enabled by default.

These features have been disabled by default since AGP 8.0 or lower. Enable these features in only the sub-projects that use them for a more efficient build.

|                      Property                       |                                                         Function                                                         |                                                                                                                                   Replacement                                                                                                                                   |
|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `android.``defaults.``buildfeatures.``aidl`         | Enables[AIDL compilation](https://source.android.com/docs/core/architecture/aidl)in all subprojects                      | Enable AIDL compilation in only the subprojects where there are AIDL sources by setting the following property in those projects' Gradle build files: ```text android { buildFeatures { aidl = true } } ``` in the Gradle build file of each subproject containing AIDL sources |
| `android.``defaults.``buildfeatures.``renderscript` | Enables[RenderScript compilation](https://source.android.com/docs/core/architecture/vndk/renderscript)in all subprojects | Enable renderscript compilation in only the subprojects where there are renderscript sources by setting the following property in those projects' Gradle build files: ```text android { buildFeatures { renderScript = true } } ```                                             |

### Enforced Gradle properties

AGP 9.0 throws an error if you set the following Gradle properties.

The[Android Gradle plugin Upgrade Assistant](https://developer.android.com/build/agp-upgrade-assistant)won't upgrade projects to AGP 9.0 that use these properties.

|                         Property                         |                                             Function                                              |
|----------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| `android.``r8.``integratedResourceShrinking`             | Resource shrinking is now always run as part of R8, the previous implementation has been removed. |
| `android.``enableNewResourceShrinker.``preciseShrinking` | Resource shrinking now always uses precise resource shrinking, which enables more to be removed.  |

## Fixed issues

### Android Gradle plugin 9.0.0-alpha10

|                                                                                                                                                                                                                                                                                                                      Fixed Issues                                                                                                                                                                                                                                                                                                                      ||
|---------------------------| |
| **Android Gradle Plugin** | |--------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #149770867](https://issuetracker.google.com/issues/149770867) extractNativeLibs and useEmbeddedDex should not be coming from the manifest | | [Issue #449114518](https://issuetracker.google.com/issues/449114518) Warnings from R8 in AGP 9.0.0-alpha09                                       |                                                                                                                                                              |
| **Lint**                  | |----------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #446696613](https://issuetracker.google.com/issues/446696613) Built-in Kotlin does not add .kotlin_module to META-INF                       | | [Issue #449031505](https://issuetracker.google.com/issues/449031505) Lint classpath contains duplicate classes at different versions               | | [Issue #448148350](https://issuetracker.google.com/issues/448148350) Overriding private resources workaround not working (tools:override = "true") | |

### Android Gradle plugin 9.0.0-alpha09

|                                                                                                                                                                                                                                                                                                              Fixed Issues                                                                                                                                                                                                                                                                                                              ||
|---------------------------| |
| **Android Gradle Plugin** | |------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #446889652](https://issuetracker.google.com/issues/446889652) \`legacy-kapt\` plugin skips annotation processing unlike \`kotlin-kapt\` | | [Issue #446492061](https://issuetracker.google.com/issues/446492061) compileSdkSpec.minorApiLevel is not working with SettingsExtension        | | [Issue #429253579](https://issuetracker.google.com/issues/429253579) \[fused lib - public\] Generated fused library does not include sources   | |

### Android Gradle plugin 9.0.0-alpha08

| Fixed Issues ||
|---|---|
| No public issues were marked as fixed in AGP 9.0.0-alpha08 ||

### Android Gradle plugin 9.0.0-alpha07

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Fixed Issues                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|---------------------------| |
| **Android Gradle Plugin** | |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #333831734](https://issuetracker.google.com/issues/333831734) A build fails if there are code generation tasks                                                                                                                                                       | | [Issue #446123111](https://issuetracker.google.com/issues/446123111) With \`android.builtInKotlin=false\` and \`android.newDsl=false\` and \`android.enableLegacyVariantApi=false\`, using \`kotlin-android\` plugin will fail with "API 'applicationVariants' is obsolete" | | [Issue #443037365](https://issuetracker.google.com/issues/443037365) Built-in Kotlin fails to resolve unversioned kotlin-stdlib when kotlin.stdlib.default.dependency=false                                                                                                 | | [Issue #445967244](https://issuetracker.google.com/issues/445967244) DexData opens a file without closing, preventing cleanup                                                                                                                                               | | [Issue #368609737](https://issuetracker.google.com/issues/368609737) AndroidSourceDirectorySet should stop extending PatternFilterable in AGP 9.0                                                                                                                           | | [Issue #389707041](https://issuetracker.google.com/issues/389707041) Test Fixture Error in test only modules                                                                                                                                                                | | [Issue #353249347](https://issuetracker.google.com/issues/353249347) Incorrect error when using context receivers in test fixtures                                                                                                                                          | | [Issue #351046197](https://issuetracker.google.com/issues/351046197) Incorrect IDE errors for Kotlin code in testFixtures                                                                                                                                                   | |

### Android Gradle plugin 9.0.0-alpha06

|                                                                                                                                                                                                                                                                                                                                                                                       Fixed Issues                                                                                                                                                                                                                                                                                                                                                                                        ||
|---------------------------| |
| **Android Gradle Plugin** | |------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #442250902](https://issuetracker.google.com/issues/442250902) New optimizaation DSL does not create configuration.txt by default        | | [Issue #443587266](https://issuetracker.google.com/issues/443587266) AGP 8.13.0 fails to verify nav graph in a module                          | | [Issue #444260628](https://issuetracker.google.com/issues/444260628) AGP uses deprecated Gradle API: multi-string notation                     | | [Issue #347732357](https://issuetracker.google.com/issues/347732357) Warn users trying to use legacy multidex library with minSdkVersion \>=21 | |
| **Lint**                  | |------------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #441536820](https://issuetracker.google.com/issues/441536820) Lint ChecksSdkIntAtLeast Check does not check if the annotated value is correct |                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### Android Gradle plugin 9.0.0-alpha05

|                                                                                                                                                                                                                                                                                                                                                                                               Fixed Issues                                                                                                                                                                                                                                                                                                                                                                                               ||
|---------------------------| |
| **Android Gradle Plugin** | |---------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #441679226](https://issuetracker.google.com/issues/441679226) android.proguard.failOnMissingFiles is not working for consumerProguardFiles | | [Issue #443051391](https://issuetracker.google.com/issues/443051391) Update Kotlin Gradle plugin dependency to 2.2.10                             | | [Issue #429981132](https://issuetracker.google.com/issues/429981132) Create KotlinJvmAndroidCompilation using KGP API                             | | [Issue #442869731](https://issuetracker.google.com/issues/442869731) Kotlin explicit API mode applied to test sources                             | |
| **Lint**                  | |---------------------------------------------------------------------------------------------------------------------------| | [Issue #440415636](https://issuetracker.google.com/issues/440415636) Lint throwing warning "Could not clean up K2 caches" |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

### Android Gradle plugin 9.0.0-alpha04

|                                                                                                                                                                                                                                                                                                                  Fixed Issues                                                                                                                                                                                                                                                                                                                  ||
|---------------------------| |
| **Android Gradle Plugin** | |--------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #369246556](https://issuetracker.google.com/issues/369246556) Switch default source/target Java version from Java 8 to Java 11 in AGP 9.0 | | [Issue #258855275](https://issuetracker.google.com/issues/258855275) Flip android.useAndroidX default to true                                    | | [Issue #442763200](https://issuetracker.google.com/issues/442763200) Better exception when applying kapt plugin with built-in Kotlin.            | |
| **Lint**                  | |---------------------------------------------------------------------------------------------------------------------------| | [Issue #440415636](https://issuetracker.google.com/issues/440415636) Lint throwing warning "Could not clean up K2 caches" |                                                                                                                                                                                                                                                                                                                                                         |

### Android Gradle plugin 9.0.0-alpha03

|                                                                                                                                                                                                                                                                                                                                                                                                                                                      Fixed Issues                                                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|---------------------------| |
| **Android Gradle Plugin** | |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #436878535](https://issuetracker.google.com/issues/436878535) When \`isIncludeAndroidResources\` is enabled, \`process{Variant}UnitTestManifest\` fails to merge tools:overrideLibrary usages in AGP 8.12.0 | | [Issue #411739086](https://issuetracker.google.com/issues/411739086) AGP causing deprecation warnings in Gradle for JVM test tasks                                                                                 | | [Issue #235457021](https://issuetracker.google.com/issues/235457021) DependencyReportTask is incompatible with the configuration cache                                                                             | |
| **Lint**                  | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #405676712](https://issuetracker.google.com/issues/405676712) Bug: removal of unused resources doesn't also remove the translations of them, and doesn't ask about it either |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Android Gradle plugin 9.0.0-alpha02

|                                                                                                                                                                                                                                                                                                                                    Fixed Issues                                                                                                                                                                                                                                                                                                                                    ||
|---------------------------| |
| **Android Gradle Plugin** | |-----------------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #294183018](https://issuetracker.google.com/issues/294183018) Fail build when proguard file does not exist                                         | | [Issue #254305041](https://issuetracker.google.com/issues/254305041) remove buildconfig defaults gradle.properties flags                                  | | [Issue #280674230](https://issuetracker.google.com/issues/280674230) Change the app's targetSdk default value to be based on compileSdk instead of minSdk | |

### Android Gradle plugin 9.0.0-alpha01

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Fixed Issues                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ||
|---------------------------| |
| **Android Gradle Plugin** | |-------------------------------------------------------------------------------------------------------------------------------------------------------| | [Issue #368426598](https://issuetracker.google.com/issues/368426598) Remove deprecated AndroidSourceSet.jni in AGP 9.0                                | | [Issue #368484483](https://issuetracker.google.com/issues/368484483) Remove Installation.installOptions() in AGP 9.0                                  | | [Issue #368482484](https://issuetracker.google.com/issues/368482484) Remove BuildType.isRenderscriptDebuggable in AGP 9.0.                            | | [Issue #428646179](https://issuetracker.google.com/issues/428646179) Remove android.defaults.buildfeatures.renderscript                               | | [Issue #436887358](https://issuetracker.google.com/issues/436887358) \`com.android.kotlin.multiplatform.library\` crashes with Gradle Managed Devices | | [Issue #428645763](https://issuetracker.google.com/issues/428645763) Remove \`android.defaults.buildfeatures.aidl\` defaults gradle.properties flags  | |

<br />