Android Gradle Plugin 8.3.0 (Feb 2024)

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

Compatibility

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

Minimum version Default version Notes
Gradle 8.4 8.4 To learn more, see updating Gradle.
SDK Build Tools 34.0.0 34.0.0 Install or configure SDK Build Tools.
NDK N/A 25.1.8937393 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.3.

Patch releases

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

Android Studio Iguana | 2023.2.1 Patch 2 and AGP 8.3.2 (April 2024)

This minor update includes these bug fixes.

Android Studio Iguana | 2023.2.1 Patch 1 and AGP 8.3.1 (March 2024)

This minor update includes these bug fixes.

Support for Gradle Version Catalogs

Android Studio supports TOML-based Gradle Version Catalogs, a feature that lets you manage dependencies in one central location and share dependencies across modules or projects. Android Studio now makes it easier to configure version catalogs through editor suggestions and integration with the Project Structure dialog. Learn how to set up and configure Gradle Version Catalogs or how to migrate your build to version catalogs.

Code completion and navigation

Android Studio offers code completion when you're editing a version catalog in the TOML file format or adding a dependency from a version catalog to a build file. To use code completion, press Ctrl+Space (Command+Space on macOS). In addition, you can quickly navigate from a dependency reference in your app's build.gradle file to where it's declared in the version catalog by pressing Ctrl+b (Command+b on macOS).

Code completion when adding a dependency

Integration with the Project Structure dialog

If your project uses a version catalog defined in the TOML file format, you can edit variables you've defined there through the Project Structure dialog Variables view (File > Project Structure > Variables) in Android Studio. For each version catalog, there is a drop-down that lists the variables from that catalog. To edit a variable, click its value and overwrite it. When you save these changes, the TOML file is updated accordingly.

Variables from a version catalog in the Project Structure dialog

You can also update dependencies in the Project Structure dialog Dependencies view (File > Project Structure > Dependencies). To update versions using the Project Structure dialog, navigate to the module and dependency you want to edit, and then update the Requested Version field. When you save these changes, the TOML file is updated accordingly. Note that if the dependency version was defined using a variable, updating the version directly this way replaces the variable with a hardcoded value. Also be aware that removing a dependency from a build file, whether you use the Project Structure dialog or not, doesn't remove the dependency from the version catalog.

Dependencies from a version catalog in the Project Structure dialog

Known issues and limitations

The following are known issues or limitations with Gradle Version Catalogs support in Android Studio.

  • Error highlighting plugin alias declarations in Kotlin script files: when you add a plugin declaration of the form alias(libs.plugins.example), the editor adds a red underline under the libs part. This is a known issue in Gradle versions 8.0 and lower and will be resolved in a future release of Gradle.

  • Android Studio support only for version catalogs in TOML format: currently the Android Studio code completion, navigation, and Project Structure dialog support is only available for version catalogs defined in the TOML file format. However, you can still add a version catalog directly in the settings.gradle file and use its dependencies in your project.

  • Navigation for KTS build files not supported: navigating to a dependency definition in a version catalog by using Control+click (Command+click on macOS) isn't yet supported for build files written using Kotlin script.

  • Firebase Assistant adds dependencies directly in build scripts: the Firebase Assistant adds dependencies directly to your build scripts instead of through version catalogs.

  • "Find usages" functionality not supported: finding usages of a version catalog variable in other build files isn't yet supported, whether the build file is in KTS or Groovy. That is, using Control+click (Command+click on macOS) on a variable definition in a version catalog doesn't lead to the build files where the variable is used.

  • The Project Structure dialog in Android Studio shows multiple catalog files if they're in the root gradle folder, but doesn't show catalogs for a composite build. For example, if you have two catalog files—one for your app and one for a composite build—the Project Structure dialog only shows the app catalog file. You can use a composite build, but you have to edit its TOML file directly.

Additional SDK insights: policy issues

Android Studio displays lint warnings in build.gradle.kts and build.gradle files and in the Project Structure Dialog for public SDKs that have Play policy violations in the Google Play SDK Index. You should update any dependencies that violate Play policies because these violations could prevent you from publishing to the Google Play Console in the future. The policy violation warnings supplement the outdated version warnings displayed by Android Studio.

Android Studio compileSdk version support

Android Studio displays a warning if your project uses a compileSdk that isn't supported by the current version of Android Studio. If available, it also suggests moving to a version of Android Studio that supports the compileSdk used by your project. Keep in mind that upgrading Android Studio might also require you upgrade AGP. AGP also displays a warning in the Build tool window if the compileSdk used by your project isn't supported by the current version of AGP.

Lint behavior changes

Starting with Android Gradle plugin 8.3.0-alpha02, when running lint on a module, separate lint analysis tasks are run for the main and test components of the module. The reason for this change is to improve performance. To revert to the earlier behavior, set android.experimental.lint.analysisPerComponent=false in your gradle.properties file.

Precise resource shrinking on by default

Precise resource shrinking, which removes unused entries from the resources.arsc file and eliminates unused resource files, is on by default. When this shrinking is enabled, your resource table is reduced and only referenced res folder entries are included in the APK.

To turn off precise resource shrinking, set android.enableNewResourceShrinker.preciseShrinking to false in your project's gradle.properties file.

Fixed issues

Android Gradle plugin 8.3.0

Fixed Issues
Android Gradle Plugin
Build cache is redundant for PackageForUnitTest task
[AGP 8.1.0] ./gradlew test fails with "Unable to find manifest output" if both splits.abi.isEnable and testOptions.unitTests.isIncludeAndroidResources are true
AGP model building fails with nested gradle composite builds
Resource shrinker mangles resource IDs, leading to runtime crashes
Minimum Gradle version check does not run on the second build and after
Execution failed for task ':app:mergeReleaseClasses' after Updating AGP from 8.0.2 to 8.1.0
[Gradle 8.4][upgrade] Integration test failure after upgrade due to use of deprecated feature in kotlin gradle plugin
Don't check for the existence of manifest overlay files during configuration phase
Broken link to Gradle doc on MergeJavaResWorkAction error
Gradle 8.1 breaks configuration caching due to .gradle/.android/analytics.settings
AGP should not use ProjectComponentIdentifier.projectPath without ProjectComponentIdentifier.build
Please reduce/remove info-level logging for AGP "Analytics other plugin to proto: ..."
[Gradle 8.4][upgrade] File operation during configuration in ProcessJavaResTask breaks config caching
Variant API to get symbol table (R.txt)
lint standalone plugin doesn't handle gradleApi() dependency properly
Poor kDocs on AGP classes/properties. `VariantOutput.enable` suggests it should be replaced with `VariantOutput.enable`
AGP 8.3.0-alpha02 cannot install release profiles on Windows hosts
Enforce `android.enableDexingArtifactTransform=true`
[Gradle 8.4][upgrade] Integration test failure after upgrade due to file handling in configuration phase
AGP 8.3.0-alpha-02 - `Error: Failed to deserialize cached resource repository.`
[Gradle 8.4][upgrade] Integration test failure after upgrade due file handling in configuration phase of TestLabBuildService
AGP 8.1.0 uninstalls app after running instrumented tests - 7.4.2 does not
Tranforming an APK leads to a error with ListingFileRedirectTask
Transforming the ASSETS artifact give broken input/output locations
Promote android.experimental.r8.dex-startup-optimization=true to be default
Migrate to new Gradle configuration alignment API
Resource compilation fails when Kotlin compiler tries to update to IDEA 21.3
Reactive get() with artifacts API
Graduate "android.lint.printStackTrace" AGP property to stable
AGP 8.1.0: dynamic feature: Implicit dependency between exportReleaseConsumerProguardFiles and extractProguardFiles cause compilation errors
`variant.unitTest.jniLibs.addGeneratedSourceDirectory` does not seem to do anything
Update XML parser used in AGP for Gradle 8.4 compatibility
AGP 8.0.1 release package jacoco instrument does not take effect
HEDGEHOG REGRESSION: Run button is delayed by a few seconds (Creating spec)
AGP 8.3.0-alpha11 produces release APK that crashes on startup with android.content.res.Resources$NotFoundException
Graduate "android.lint.printStackTrace" AGP property to stable
Feature Request: Promote com.android.build.api.extension.impl.CURRENT_AGP_VERSION to a public API
SDK Manager should stop spamming log info to stdout
DexArchiveBuilderTaskDelegate was failed with resource only library module
AGP7.4 custom plugin variant toTransform for all throw duplicate entry: META-INF/MANIFEST.MF exception
Support new Manifest tags,
The link for "decoupled Projects" in studio settings goes to the wrong place.
Please provide options to include generated sources on Javadoc and SourceJar
Need quick fix for discrepancy between compileSdk and dependency with minCompileSdkVersion
[Gradle] tools:overrideLibrary should support asterisk (*)
UI Freeze when editing manifest
Unable to set JaCoCo version in AGP 8.2.0
Android Gradle Plugin 8.2.0 install task fails in project that uses dynamic features
Android Gradle Plugin 8.2.0 install task fails in project that uses dynamic features
Dexer (D8)
[desugared library] Desugared library version 2.1 is not compatible with previous versions of R8
Optimizations running even just with D8?
Lint
[Lint] TranslucentViewDetector crashes in filterIncident function and causes lint to produce wrong result
TranslucentViewDetector should accept "behind" value
Android Lint fails on a KMP library with `property 'variantInputs.name' doesn't have a configured value.`
TranslucentViewDetector report wrong line in manifest
lintDebug falsely reports UseTomlInstead warnings when using project dependencies
Unexpected issues from another project flagged by Android Lint
LINT check Unused Resource false positive detection inside of binding and click listener
Could not load custom lint check jar file: Node cannot be cast to TreeNode
Lint visitAnnotationUsage not called for usages of annotated classes in variable declarations
Lint 31.0.2 fails with java.util.NoSuchElementException: Array is empty.
No Lint warning about kotlin.text.MatchNamedGroupCollection#get(String) requiring API 26
lint:TypographyQuotes false negatives: more than one escaped apostrophe are ignored
AGP 8.0.2 lint InvalidId detector false positive
LintError issues added to lint baselines
Quickfix Lint doesn't work and results in an IDE error
Inconsistent test failure due to partial analysis
Invalid highlight of an warning which is false positive
Lint visitAnnotationUsage not called for usages of annotated classes in variable declarations
Unused Resources Processor might delete Gradle build file
NewApi lint check does not undertand "isAtleastU() && otherCondition()" final field
StackOverflow from `LintClient.getSdkHome`
Android Studio / Lint doesn't tell you when "platform" dependencies are out of date
Bug: no suggestion to update Firebase-bom dependency
Project Structure (and Gradle (?)) does not discover Firebase BOM dependencies to be upgraded to a newer version.
Lint Integration
DuplicatePlatformClasses lint error from testImplementation dependency
Shrinker (R8)
R8 doesn't work after upgrade from AGP 8.0.2 to 8.1.0
isShrinkResources overoptimizes in 8.3.0-alpha11 to alpha14
R8 Flurry SDK crash with AGP 8.2.0
Android - R8 causes subclass of LinearLayoutManager to crash
R8 v8.2.33, "java.lang.VerifyError: Bad type on operand stack" runtime crash after upgrade
[R8 8.3.21] R8 8.3.21 is 1.57MB larger than R8 8.1.56
[R8 8.3.21] R8 8.3.21 is 1.57MB larger than R8 8.1.56
class.getInterfaces() return empty
Test SimpleKotlinEnumUnboxingTest fails on kotlin_dev bot

Android Gradle plugin 8.3.1

Fixed Issues
Android Gradle Plugin
MergeJavaResourcesTask incremental inputs handling issue
Lint Integration
Lint cannot resolve sibling source sets' types in AGP 8.3.0-rc02

Android Gradle plugin 8.3.2

Fixed Issues
Android Gradle Plugin
AGP 8.3 with desugaring enabled deadlock can happen
AGP 8.3 breaks zipApksFor Task
Lint Integration
Lint unable to disambiguate a KMP dependency