Android Gradle plugin release notes

Stay organized with collections Save and categorize content based on your preferences.
The JCenter repository became read-only on March 31st, 2021. For more information, see JCenter service update.

The Android Studio build system is based on Gradle, and the Android Gradle plugin adds several features that are specific to building Android apps. Although the Android plugin is typically updated in lock-step with Android Studio, the plugin (and the rest of the Gradle system) can run independent of Android Studio and be updated separately.

This page explains how to keep your Gradle tools up to date and what's in the recent updates. For the release notes for past Android Gradle plugin versions, see past release notes.

For a high-level summary of upcoming breaking changes in the Android Gradle plugin, see the Android Gradle plugin roadmap.

For details about how to configure your Android builds with Gradle, see the following pages:

For more information about the Gradle build system, see the Gradle user guide.

Update the Android Gradle plugin

When you update Android Studio, you may receive a prompt to automatically update the Android Gradle plugin to the latest available version. You can choose to accept the update or manually specify a version based on your project's build requirements.

You can specify the plugin version in either the File > Project Structure > Project menu in Android Studio, or the top-level build.gradle file. The plugin version applies to all modules built in that Android Studio project. The following example sets the plugin to version 7.3.0 from the build.gradle file:

Groovy

plugins {
    id 'com.android.application' version '7.3.0' apply false
    id 'com.android.library' version '7.3.0' apply false
    id 'org.jetbrains.kotlin.android' version '1.5.31' apply false
}

Kotlin

plugins {
    id("com.android.application") version "7.3.0" apply false
    id("com.android.library") version "7.3.0" apply false
    id("org.jetbrains.kotlin.android") version "1.5.31" apply false
}

Caution: You should not use dynamic dependencies in version numbers, such as 'com.android.tools.build:gradle:2.+'. Using this feature can cause unexpected version updates and difficulty resolving version differences.

If the specified plugin version has not been downloaded, Gradle downloads it the next time you build your project or click File > Sync Project with Gradle Files from the Android Studio menu bar.

Update Gradle

When you update Android Studio, you may receive a prompt to also update Gradle to the latest available version. You can choose to accept the update or manually specify a version based on your project's build requirements.

The following table lists which version of Gradle is required for each version of the Android Gradle plugin. For the best performance, you should use the latest possible version of both Gradle and the plugin.

Plugin versionMinimum required Gradle version
8.08.0
7.47.5
7.37.4
7.27.3.3
7.17.2
7.07.0
4.2.0+6.7.1

Older versions

Plugin versionRequired Gradle version
4.1.0+6.5+
4.0.0+6.1.1+
3.6.0 - 3.6.45.6.4+
3.5.0 - 3.5.45.4.1+
3.4.0 - 3.4.35.1.1+
3.3.0 - 3.3.34.10.1+
3.2.0 - 3.2.14.6+
3.1.0+4.4+
3.0.0+4.1+
2.3.0+3.3+
2.1.3 - 2.2.32.14.1 - 3.5
2.0.0 - 2.1.22.10 - 2.13
1.5.02.2.1 - 2.13
1.2.0 - 1.3.12.2.1 - 2.9
1.0.0 - 1.1.32.2.1 - 2.3

You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or update your Gradle version using the command line. The preferred way is to use the Gradle Wrapper command line tool, which updates the gradlew scripts. The following example sets the Gradle version to 7.5.1 using the Gradle Wrapper. Note, you need to run this command twice to upgrade both Gradle and the Gradle Wrapper itself (for more information, see Upgrading the Gradle Wrapper).

./gradle wrapper --gradle-version --7.5.1

However this might fail in some cases, for example if you've just updated AGP and it's no longer compliant with the current Gradle version. In this case, you need to edit the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file. The following example sets the Gradle version to 7.5.1 in the gradle-wrapper.properties file.

...
distributionUrl = "https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip"
...

Android Gradle plugin and Android Studio compatibility

The Android Studio build system is based on Gradle, and the Android Gradle plugin adds several features that are specific to building Android apps. The following table lists which version of the Android Gradle plugin is required for each version of Android Studio.

Android Studio version Required plugin version
Flamingo | 2022.2.1 3.2-8.0
Electric Eel | 2022.1.1 3.2-7.4
Dolphin | 2021.3.1 3.2-7.3
Chipmunk | 2021.2.1 3.2-7.2
Bumblebee | 2021.1.1 3.2-7.1
Arctic Fox | 2020.3.1 3.1-7.0

For information on what’s new in the Android Gradle plugin, see the Android Gradle plugin release notes.

Versioning changes (November 2020)

We are updating the version numbering for Android Gradle plugin (AGP) to more closely match the underlying Gradle build tool.

Here are the notable changes:

  • AGP will now use semantic versioning, and breaking changes will be targeted for major releases.

  • There will be one major version of AGP released per year, aligned with the Gradle major release.

  • The release after AGP 4.2 will be version 7.0 and will require an upgrade to Gradle version 7.x. Every major release of AGP will require a major version upgrade in the underlying Gradle tool.

  • APIs will be deprecated approximately one year in advance, with replacement functionality made available concurrently. Deprecated APIs will be removed approximately one year later during the subsequent major update.

7.3.0 (September 2022)

Android Gradle plugin 7.3.0 is a major release that includes a variety of new features and improvements.

Compatibility

Minimum version Default version Notes
Gradle 7.4 7.4 To learn more, see updating Gradle.
SDK Build Tools 30.0.3 30.0.3 Install or configure SDK Build Tools.
NDK N/A 23.1.7779620 Install or configure a different version of the NDK.
JDK 11 11 To learn more, see setting the JDK version.

Support for custom C/C++ build systems

You can now create a custom C/C++ build system by making a shell script that writes build information in the Ninja build file format. To learn more about custom C/C++ build systems see Integrate custom C/C++ build systems using Ninja (experimental).

Screenshot of custom C/C++ build system

Minimum Kotlin plugin version is 1.5.20

Starting with Android Gradle plugin 7.3.0-alpha08, AGP requires Kotlin plugin version 1.5.20 or higher. To stay compatible, make sure to specify Kotlin plugin version 1.5.20 or higher in your build.gradle file:

org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20

Archived APK generation enabled

Starting with AGP 7.3, all Android App Bundles built have Store Archival enabled by default. Archival is a new app bundle feature that in the future will allow users with low storage to effectively manage their app space, if supported by the store.

To opt out of the generation of archived APKs, modify the app-level build.gradle file as follows:

android {
  bundle {
    storeArchive {
      enable = false
    }
  }
}

Package attribute in manifest file is deprecated

Starting with AGP 7.3.0-alpha04, if you use Gradle to build your project, AGP generates a warning if you use the package attribute in the manifest file. To set the namespace for your app, use the namespace property in the module-level build.gradle file. To learn more, see Set a namespace.

To get help moving to the new namespace DSL, use the AGP Upgrade Assistant (Tools > AGP Upgrade Assistant).

Android platform support

Starting with AGP 7.3.0-beta05, the highest supported minimum SDK version is 33 (you can use minSdk = 33). The minimum SDK represents the minimum version of Android that your app can run on and is set in the app-level build.gradle file.