Android Gradle Plugin 8.5.0 (June 2024)

Android Gradle Plugin 8.5.0 is a major release that includes a variety of new features and improvements.

Compatibility

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

Minimum version Default version Notes
Gradle 8.7 8.7 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.

Fixed issues

Android Gradle plugin 8.5.0

Fixed Issues
Android Gradle Plugin
AAPT: error: attribute 'package' in tag is not a valid Android package name: 'butterknife'.
AGP 8.3 breaks zipApksFor Task
Privacy Sandbox Proguard rule generation fails on empty sdk provider classname
Compose preview unable to resolve classes from transitive dependency
JavaPreCompileTask includes KSP classpath dependencies when computing non-incremental annotation processors
Execution failed for task ':app:generateDebugLocaleConfig'.
DexingNoClasspathTransform (minSdk >= 24) with Java 11 target fails due to missing nest members
With `android.useFullClasspathForDexingTransform = true`, the build fails with `Found multiple transforms that can produce a variant`
Errors when running lint with and without K2 UAST
Lint
buildList - False Positive Lint warning
Lint Integration
Lint unable to disambiguate a KMP dependency

Android Gradle plugin 8.5.1

Fixed Issues
Android Gradle Plugin
[Koala 2024.1.2 Canary 2] Error running a baseline profile module on a split APK

Android Gradle plugin 8.5.2

Fixed Issues
Android Gradle Plugin
AGP 8.5: Many more "mergeDebugResources" tasks are run, slowing down builds
Adding srcs dir via Variant API not working as expected
Dexer (D8)
java.lang.VerifyError: Verifier rejected class com.pax.log.LogUtils: java.lang.StackTraceElement com.pax.log.LogUtils.getCaller(com.pax.log.b, java.lang.StackTraceElement[], int) failed to verify
Lint
Lint: SetTextI18n complains about assigning an empty string.
Shrinker (R8)
[r8 8.5]r8 horizontal class merge causes verify error on Android5 when disable api modeling
A Wear OS release built with Gradle Plugin 8.4.0/8.5.0 may cause java.lang.IllegalAccessError
[r8 8.5] vertical class merger causing runtime NPE
Gradle Sync with AGP 8.6.0-alpha06 fails with "Unexpected backport missing from Android U" error in R8
The dex file generated by R8 shows "Unable to find static main(String[]) in 'Test'" when executed
Different Behavior Between Programs packed by R8 and D8
R8 (AGP 8.5.0+) fails with error "Unexpected rewriting of item: ... to two distinct items:..."
R8 Processing Error Possibly Due to Right Shift Operator
R8 NullPointer after updating to Kotlin 2.0