Android Gradle Plugin 8.4.0 (Apr 2024)

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

Compatibility

The maximum API level that Android Gradle plugin 8.4 supports is API level 34. Here is other compatibility info:

Minimum version Default version Notes
Gradle 8.6 8.6 To learn more, see updating Gradle.
SDK Build Tools 34.0.0 34.0.0 Install or configure SDK Build Tools.
NDK N/A 26.1.10909125 Install or configure a different version of the NDK.
JDK 17 17 To learn more, see setting the JDK version.

The following are new features in Android Gradle plugin 8.4.

Patch releases

The following is a list of the patch releases in Android Studio Jellyfish and Android Gradle plugin 8.4.

Android Studio Jellyfish | 2023.3.1 Patch 2 and AGP 8.4.2 (June 2024)

Important security update: A security vulnerability in the GitHub plugin available in Android Studio Iguana | 2023.2.1 and higher could expose access tokens to unauthorized parties.

The fix: Jetbrains has resolved the issue in IntelliJ platform products, and the fix is now available in Android Studio Jellyfish | 2023.3.1 Patch 2 (2023.3.1.20).

If you already have an Android Studio build on the stable channel, you can get the update by clicking Help > Check for Updates (or Android Studio > Check for Updates on macOS). Otherwise, download the latest stable build.

Furthermore, if you've actively used GitHub pull request functionality in the IDE, we strongly advise that you revoke any GitHub tokens being used by the plugin. Given that the plugin can use OAuth integration or personal access tokens (PATs), please check both and revoke as necessary:

  • To revoke access for OAuth integration, go to Applications > Authorized OAuth Apps and revoke access for the JetBrains IDE Integration token.
  • To revoke access for PATs, go to Personal access tokens and delete the token issued for the GitHub plugin. The default token name is IntelliJ IDEA GitHub integration plugin, but you might be using a custom name.

After revoking access for the token(s), you need to set up the plugin again get all the plugin features, including Git operations, to work again.

We apologize for any inconvenience and urge all users to update immediately to safeguard their code and data.

This minor update also includes these bug fixes.

Android Studio Jellyfish | 2023.3.1 Patch 1 and AGP 8.4.1 (May 2024)

This minor update includes these bug fixes.

Library classes are shrunk

Starting with Android Gradle Plugin 8.4, if an Android library project is minified, shrunk program classes will be published for inter-project publishing. This means that if an app depends on the shrunk version of the Android library subprojects, the APK will include shrunk Android library classes. You may need to adjust library keep rules in case there are missing classes in the APK.

In case you are building and publishing an AAR, local jars that your library depends on will be included unshrunk in the AAR, which means code shrinker won't run on them.

To revert to previous behavior, set android.disableMinifyLocalDependenciesForLibraries in the gradle.properties file and file a bug. Future versions of AGP will remove this flag remove this flag.

Fixed issues

Android Gradle plugin 8.4.0

Fixed Issues
Android Gradle Plugin
Improve error message for why `--release` option can't be used for JavaCompile
Disable caching of MergeSourceSetFolders using @DoNotCacheByDefault
Unable to set JaCoCo version in AGP 8.2.0
DynamicFeatureBuildType is missing isDebuggable
Minified library classes are not published correctly for inter-project consumption
Provide Variant#sources API that excludes generated files
AGP models do not contain java-platform project dependencies
ExtractAarTransform creates non-reproducible classes.jar for aars that have no classes.jar
Allow to configure sourceInformation from ComposeOptions
Cannot find field: sdk_runtime in message android.bundle.DeviceSpec
Support for compileOnlyApi
R8 fails on a library module when resource processing is disabled
Add ability to change artifact name during transformation
Adding task output to as srcDir of sourceSets.androidMain.resources does not create a task dependencies
AndroidPluginVersion.toString() is missing leading 0s
Artifacts.add(FileSystemLocation) should be more restrictive.
AGP 8.3.0-alpha11 produces release APK that crashes on startup with android.content.res.Resources$NotFoundException
Android Gradle Plugin 8.2.0 install task fails in project that uses dynamic features
AIDL compile fails with IndexOutOfBoundsException: Index 0 out of bounds for length 0
MergeJavaResourcesTask incremental inputs handling issue
AGP 8.3.0-alpha02 depends on libraries with known security vunelaribilities
Selected activity template requires project with androidx.* dependencies
AGP Upgrade Assistent errouneously removes consumerProguardFiles from module
AGP Upgrade Assistant Loads Infinitely
SourceDirectories#static shouldn't depend on GenerateBuildConfig task
Compose preview unable to resolve classes from transitive dependency
AGP 8.3 breaks zipApksFor Task
AndroidX Desktop artifacts packaged in Android APK
Lint
Lint testing framework's GradleModelMocker does not allow setting library version
Lint K2 UAST: UCallableReferenceExpression reports wrong qualifierType
Lint false positive with useK2Uast=true with overloaded functions
[BuildTool/Lint] ChecksSdkIntAtLeast constructor property
Lint Integration
Lint unable to disambiguate a KMP dependency

Android Gradle plugin 8.4.1

Fixed Issues
Android Gradle Plugin
Allow suppressing a warning about JDK 21 deprecating support for targeting java 8
Dexer (D8)
java.lang.VerifyError: Verifier rejected class
New version R8 format conversion error after obfuscation
Intermediate builds may not have complete global synthetic content for stubs

Android Gradle plugin 8.4.2

Fixed Issues
Android Gradle Plugin
AGP 8.4 seems to break GMD downloads on CI