Android Gradle Plugin 9.3.0

9.3.0
Added 3
  • Standalone R8 Configuration Analyzer Gradle task to run the R8 Configuration Analyzer in isolation without completing the APK or Bundle compilation pipeline
  • Updated optimization DSL to configure keep rules for R8 optimization with a new optimization block in build types
  • Source sets support for keep rules in src/<variant>/keepRules/ with .keep file suffix
Changed 4
  • Maximum API level supported increased to API level 37
  • Minimum Gradle version requirement is now 9.5.0
  • SDK Build Tools default and minimum version updated to 36.0.0
  • NDK default version updated to 28.2.13676358

From Android Gradle Plugin

Android Gradle plugin 9.3 is a minor release that includes a variety of new features and improvements.

Compatibility

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

Minimum versionDefault versionNotes
Gradle9.5.09.5.0To learn more, see updating Gradle.
SDK Build Tools36.0.036.0.0Install or configure SDK Build Tools.
NDKN/A28.2.13676358Install or configure a different version of the NDK.
JDK1717To learn more, see setting the JDK version.
Standalone R8 Configuration Analyzer Gradle task

Android Gradle plugin 9.3 introduces a dedicated Gradle task for running the R8 Configuration Analyzer in isolation. The R8 Configuration Analyzer helps you optimize your app's code shrinking and obfuscation rules.

./gradlew :app:analyzeReleaseR8Config

The :app:analyzeReleaseR8Config task generates the report without completing the APK or Bundle compilation pipeline. This provides a shorter feedback loop, which speeds up developer iteration when refining keep rules. Alternatively, you can generate the report automatically by running an R8 release build (such as assembleRelease or bundleRelease).

For more information, see Run the standalone Gradle task for generating report.

Fixed issues
Android Gradle plugin 9.3.0
Fixed Issues
No public issues were marked as fixed in AGP 9.3.0
Updated optimization DSL to configure R8 keep rules

Introduces an updated optimization DSL to configure keep rules for R8 optimization, supported by app modules and library module tests. To configure optimization with the updated DSL, use the new optimization block. For apps, configure the optimization block within a build type (such as release or debug) in the app-level build script. The updated optimization DSL makes R8 configuration simpler:

  • Turning on optimization enables both code optimization and optimized resource shrinking.
  • You no longer need to specify the default Android keep rules file.

Note that the legacy DSL continues to be supported.

Introduction of source sets to define keep rules

Place keep rules in the src/<variant>/keepRules/ source set, with the file-suffix .keep. Source sets for keep rules are supported by the updated optimization DSL and the legacy DSL. Using source sets for keep rules is supported in app modules, library modules, and as a way to define consumer rules in Kotlin Multiplatform (KMP) modules.

View original

Upgraded? How did it go?

Discussion