Android Studio 4.2 Canary 6 is now available in the Canary and Dev channels.
If you have Android Studio set to receive updates on the Canary or Dev channel, you can get the update by choosing Help > Check for Updates (Android Studio > Check for Updates on macOS). Otherwise, you can download it here.
For information on new features and changes in all preview builds of Android Studio 4.2, see the Android Studio Preview release notes. For details of bugs fixed in each preview release, see previous entries on this blog.
We greatly appreciate your bug reports, which help us to make Android Studio better. If you encounter a problem, let us know by reporting a bug. Note that you can also vote for an existing issue to indicate that you are also affected by it.
New JVM resource compiler
A new JVM resource compiler is now available in Android Gradle plugin 4.2. This tool replaces portions of the AAPT2 resource compiler, and can potentially improve build performance, especially on Windows machines.
To try out the JVM resource compiler, enable it in your project's gradle.properties
file:
android.enableJvmResourceCompiler=true
New removable
setting for dynamic feature modules
Android Gradle plugin 4.2 uses bundletool
1.0.0, which introduces a behavior
change for apps using dynamic feature modules: Any dynamic feature module
specified as dist:install-time
that's not explicitly marked as
dist:removable
will become non-removable by default. This new setting
optimizes fusing of install-time modules with the base module, potentially
improving app performance for some apps.
For more information on this new setting, see the documentation for the
dist:removable
tag in the documentation for
Dynamic feature module manifest.
General Fixes
Android Gradle Plugin- Issue #160155450: BuildConfig not correctly honoring contract around quotations in String[]
- Issue #157590496: Make the order of entries in APKs deterministic for clean debug builds, unless building from AS
- Issue #155920880: Layout Inspector preview is jumping all over the place
- Issue #155088391: Can no longer specify layout_height and layout_width in a style
- Issue #161370707: Lint assertion check flags simple instanceof checks
Build Variants
- Issue #160851593: Build Variants for dynamic feature modules don't switch when app's build variant is switched
- Issue #144891963: Running an individual instrumented test doesn't work
- Issue #139769779: Dialog for recommendation about "Android Gradle Plugin Update" shows up in the wrong Android Studio Window
Additionally the below issues were addressed in this release but may not necessarily be fixed:
Build Variants- Issue #160851593: Build Variants for dynamic feature modules don't switch when app's build variant is switched
- Issue #144891963: Running an individual instrumented test doesn't work
- Issue #139769779: Dialog for recommendation about "Android Gradle Plugin Update" shows up in the wrong Android Studio Window