Stay organized with collections
Save and categorize content based on your preferences.
Android Gradle Plugin 3.4.0 (April 2019)
This version of the Android plugin requires the following:
|
Minimum version |
Default version |
Notes |
Gradle |
5.1.1 |
5.1.1 |
To learn more, see updating Gradle. When using Gradle 5.0 and higher, the default Gradle daemon memory heap size decreases from 1 GB to 512 MB. This might result in a build performance regression. To override this default setting, specify the Gradle daemon heap size in your project's gradle.properties file. |
SDK Build Tools |
28.0.3 |
28.0.3 |
Install or configure SDK Build Tools. |
3.4.3 (July 2020)
This minor update supports compatibility with new default settings and
features for
package visibility
in Android 11.
See the 4.0.1 release notes for details.
3.4.2 (July 2019)
This minor update supports Android Studio 3.4.2 and includes various bug
fixes and performance improvements.
To see a list of noteable bug fixes, read the related post on the
Release Updates blog.
3.4.1 (May 2019)
This minor update supports Android Studio 3.4.1 and includes various bug
fixes and performance improvements.
To see a list of noteable bug fixes, read the related post on the
Release Updates blog.
New features
-
New lint check dependency configurations: The
behavior of lintChecks
has changed and a new dependency
configuration, lintPublish
, has been introduced to give
you more control over which lint checks are packaged in your Android
libraries.
-
lintChecks
: This is an existing configuration that
you should use for lint checks you want to only run when building
your project locally. If you were previously using the
lintChecks
dependency configuration to include lint
checks in the published AAR, you need to migrate those dependencies
to instead use the new lintPublish
configuration
described below.
-
lintPublish
: Use this new configuration in library
projects for lint checks you want to include in the published AAR,
as shown below. This means that projects that consume your library
also apply those lint checks.
The following code sample uses both dependency configurations in a
local Android library project.
dependencies {
// Executes lint checks from the ':lint' project at build time.
lintChecks project(':lint')
// Packages lint checks from the ':lintpublish' in the published AAR.
lintPublish project(':lintpublish')
}
dependencies {
// Executes lint checks from the ':lint' project at build time.
lintChecks(project(":lint"))
// Packages lint checks from the ':lintpublish' in the published AAR.
lintPublish(project(":lintpublish"))
}
Behavior changes
-
Android Instant Apps Feature plugin deprecation
warning: If you’re still using the
com.android.feature
plugin to build your instant app,
Android Gradle plugin 3.4.0 will give throw you a deprecation warning.
To make sure you can still build you instant app on future versions of
the plugin, migrate your instant app to using
the dynamic feature plugin,
which also allows you to publish both your installed and instant app
experiences from a single Android App Bundle.
-
R8 enabled by default: R8 integrates desugaring,
shrinking, obfuscating, optimizing, and dexing all in one step—resulting
in
noticeable build performance
improvements. R8 was introduced in Android Gradle plugin 3.3.0 and
is now enabled by default for both app and Android library projects
using plugin 3.4.0 and higher.
The image below provides a high-level overview of the compile process
before R8 was introduced.
Now, with R8, desugaring, shrinking, obfuscating, optimizing, and dexing (D8)
are all completed in one step, as illustrated below.
Keep in mind, R8 is designed to work with your existing ProGuard rules, so
you’ll likely not need to take any actions to benefit from R8. However,
because it’s a different technology to ProGuard that’s designed specifically
for Android projects, shrinking and optimization may result in removing code
that ProGuard may have not. So, in this unlikely situation, you might need
to add additional rules to keep that code in your build output.
If you experience issues using R8, read the
R8 compatibility FAQ
to check if there’s a solution to your issue. If a solution isn’t documented,
please report a bug.
You can disable R8 by adding one of the following lines to your project’s
gradle.properties
file:
# Disables R8 for Android Library modules only.
android.enableR8.libraries = false
# Disables R8 for all modules.
android.enableR8 = false
Note: For a given build type, if you set
useProguard
to false
in your app
module's build.gradle
file, the Android Gradle plugin uses R8
to shrink your app's code for that build type, regardless of whether you
disable R8 in your project's gradle.properties
file.
-
ndkCompile
is deprecated: You now get a
build error if you try to use ndkBuild
to compile your
native libraries. You should instead use either CMake or ndk-build to
Add C and C++ code to your
project.
Known issues
-
The correct usage of unique package names are currently not enforced
but will become more strict on later versions of the plugin. On Android
Gradle plugin version 3.4.0, you can opt-in to check whether your
project declares acceptable package names by adding the line below to
your gradle.properties
file.
android.uniquePackageNames = true
To learn more about setting a package name through the Android Gradle
plugin, see
Set the application ID.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-21 UTC."],[],[],null,["\u003cbr /\u003e\n\nAndroid Gradle Plugin 3.4.0 (April 2019)\n========================================\n\nThis version of the Android plugin requires the following:\n\n| | Minimum version | Default version | Notes |\n|----------------:|:---------------:|:---------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|\n| Gradle | 5.1.1 | 5.1.1 | To learn more, see [updating Gradle](/build/releases/gradle-plugin?buildsystem=ndk-build#updating-gradle). When using Gradle 5.0 and higher, the default Gradle daemon memory heap size decreases from 1 GB to 512 MB. This might result in a build performance regression. To override this default setting, specify the Gradle daemon heap size in your project's gradle.properties file. |\n| SDK Build Tools | 28.0.3 | 28.0.3 | [Install](/studio/intro/update#sdk-manager) or [configure](/tools/releases/build-tools) SDK Build Tools. |\n\n**3.4.3 (July 2020)**\n\n\nThis minor update supports compatibility with new default settings and\nfeatures for\n[package visibility\nin Android 11](/about/versions/11/privacy/package-visibility).\n\n\nSee the [4.0.1 release notes](#4.0.1) for details.\n\n**3.4.2 (July 2019)**\n\n\nThis minor update supports Android Studio 3.4.2 and includes various bug\nfixes and performance improvements.\nTo see a list of noteable bug fixes, read the related post on the\n[Release Updates blog](https://androidstudio.googleblog.com/2019/07/android-studio-342-available.html).\n\n**3.4.1 (May 2019)**\n\n\nThis minor update supports Android Studio 3.4.1 and includes various bug\nfixes and performance improvements.\nTo see a list of noteable bug fixes, read the related post on the\n[Release Updates blog](https://androidstudio.googleblog.com/2019/05/android-studio-341-available.html).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nNew features\n------------\n\n- **New lint check dependency configurations:** The\n behavior of `lintChecks` has changed and a new dependency\n configuration, `lintPublish`, has been introduced to give\n you more control over which lint checks are packaged in your Android\n libraries.\n\n - `lintChecks`: This is an existing configuration that you should use for lint checks you want to only run when building your project locally. If you were previously using the `lintChecks` dependency configuration to include lint checks in the published AAR, you need to migrate those dependencies to instead use the new `lintPublish` configuration described below.\n - `lintPublish`: Use this new configuration in library projects for lint checks you want to include in the published AAR, as shown below. This means that projects that consume your library also apply those lint checks.\n\n The following code sample uses both dependency configurations in a\n local Android library project. \n\n ```groovy\n dependencies {\n // Executes lint checks from the ':lint' project at build time.\n lintChecks project(':lint')\n // Packages lint checks from the ':lintpublish' in the published AAR.\n lintPublish project(':lintpublish')\n }\n \n ``` \n\n ```kotlin\n dependencies {\n // Executes lint checks from the ':lint' project at build time.\n lintChecks(project(\":lint\"))\n // Packages lint checks from the ':lintpublish' in the published AAR.\n lintPublish(project(\":lintpublish\"))\n }\n \n ```\n - In general, packaging and signing tasks should see an overall build\n speed improvement. If you notice a performance regression related to\n these tasks, please [report a bug](/studio/report-bugs).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nBehavior changes\n----------------\n\n- **Android Instant Apps Feature plugin deprecation\n warning:** If you're still using the\n `com.android.feature` plugin to build your instant app,\n Android Gradle plugin 3.4.0 will give throw you a deprecation warning.\n To make sure you can still build you instant app on future versions of\n the plugin, migrate your instant app to using\n [the dynamic feature plugin](/studio/projects/dynamic-delivery),\n which also allows you to publish both your installed and instant app\n experiences from a single Android App Bundle.\n\n- **R8 enabled by default:** R8 integrates desugaring,\n shrinking, obfuscating, optimizing, and dexing all in one step---resulting\n in\n [noticeable build performance\n improvements](https://www.google.com/url?q=https://android-developers.googleblog.com/2018/11/r8-new-code-shrinker-from-google-is.html&sa=D&ust=1551922493258000&usg=AFQjCNH0N1wuMX645n7giw0wjikzjm3WCA). R8 was introduced in Android Gradle plugin 3.3.0 and\n is now enabled by default for both app and Android library projects\n using plugin 3.4.0 and higher.\n\nThe image below provides a high-level overview of the compile process\nbefore R8 was introduced.\n\nNow, with R8, desugaring, shrinking, obfuscating, optimizing, and dexing (D8)\nare all completed in one step, as illustrated below.\n\nKeep in mind, R8 is designed to work with your existing ProGuard rules, so\nyou'll likely not need to take any actions to benefit from R8. However,\nbecause it's a different technology to ProGuard that's designed specifically\nfor Android projects, shrinking and optimization may result in removing code\nthat ProGuard may have not. So, in this unlikely situation, you might need\nto add additional rules to keep that code in your build output.\n\nIf you experience issues using R8, read the\n[R8 compatibility FAQ](https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md)\nto check if there's a solution to your issue. If a solution isn't documented,\nplease [report a bug](https://issuetracker.google.com/issues/new?component=326788&template=1025938).\nYou can disable R8 by adding one of the following lines to your project's\n`gradle.properties` file: \n\n # Disables R8 for Android Library modules only.\n android.enableR8.libraries = false\n # Disables R8 for all modules.\n android.enableR8 = false\n \n \n**Note:** For a given build type, if you set\n`useProguard` to `false` in your app\nmodule's `build.gradle` file, the Android Gradle plugin uses R8\nto shrink your app's code for that build type, regardless of whether you\ndisable R8 in your project's `gradle.properties` file.\n\n- **`ndkCompile` is deprecated:** You now get a build error if you try to use `ndkBuild` to compile your native libraries. You should instead use either CMake or ndk-build to [Add C and C++ code to your\n project](/studio/projects/add-native-code).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nKnown issues\n------------\n\n- The correct usage of unique package names are currently not enforced\n but will become more strict on later versions of the plugin. On Android\n Gradle plugin version 3.4.0, you can opt-in to check whether your\n project declares acceptable package names by adding the line below to\n your `gradle.properties` file.\n\n android.uniquePackageNames = true\n \n \n To learn more about setting a package name through the Android Gradle\n plugin, see\n [Set the application ID](/studio/build/configure-app-module#set_the_application_id).\n\n\u003cbr /\u003e"]]