Google is committed to advancing racial equity for Black communities. See how.

New features in Android Studio Preview

Android Studio 4.1 has been released to the stable channel. Download it here.

Android Studio 4.2 is currently in the Canary and Dev channels.

For the latest news on releases, including a list of notable fixes in each release, also see the Release updates.

If you encounter any problems using a preview version of Android Studio, please let us know. Your bug reports help to make Android Studio better.

Android Studio 4.2

System Trace: Improved metrics for memory and graphics

In the CPU profiler, the System Trace feature now includes new metrics for analyzing app performance.

Events Table

The Events table is a new tab on the right-hand side of the Analysis pane. This table lists all trace events in the currently selected thread.

System Trace Events table

New tracks and track groups

More data is now available in System Trace for traces of apps deployed to devices running Android 9 or higher.

BufferQueue (in the Display section)

This new track shows the buffer count of the app's surface BufferQueue (0, 1 or 2). It can help you understand the state of image buffers as they move between the Android graphics components. For example, a value of 2 means the app is currently triple-buffered, which may result in extra input latency.

System Trace Buffer Queue

CPU Frequency (in the CPU cores section)

In addition to CPU scheduling data, we also included CPU frequency by core. This shows how hard each core is working and may give you an idea of which ones are the "big" or "little" cores in modern mobile processors.

System Trace CPU Frequency

Process Memory (RSS)

The new Process Memory (RSS) shows the amount of physical memory currently in use by the app.

System Trace Process Memory (RSS)


This is the total amount of physical memory currently in use by your process. On Unix-based systems, this is known as the "Resident Set Size", and is the combination of all the memory used by anonymous allocations (those backed by the swap file), file mappings (files which are loaded into memory a page at a time), and shared memory allocations (accessed by multiple processes, and allocated by a variety of mechanisms).

For Windows developers, Resident Set Size is analogous to the Working Set Size.


This counter tracks how much physical memory is currently used by the process’s normal memory allocations. These are allocations which are both anonymous (not backed by a specific file) and private (not shared).

File Mappings

This counter tracks how much physical memory is being used by any file mappings owned by the process.


This counter tracks how much physical memory is being used to share memory between this process and other processes in the system.

R8 retrace now available in command-line tools

Available in version 4.0 of the command-line tools, R8 retrace is a standalone tool for obtaining the original stack trace from an obfuscated stack trace.

You can download this package with the SDK manager, which installs R8 retrace in android_sdk/cmdline-tools. Alternatively, you can download the standalone command-line tools package.

For usage information, see R8 retrace in the user guide.

New Layout Inspector refresh action

Introduced in Android Studio 4.0, the Layout Inspector was designed for real-time inspection of your running app’s UI stack. However, you might not always want the Layout Inspector to immediately reflect what’s happening in your app, since you might want to inspect a snapshot of your app’s layout at a specific point in time or minimize the performance impact of live updates on your app.

Pause live updates and refresh the screen capture in the Layout Inspector.

To manually load a snapshot of UI data from your app, first disable the Live updates option. You can then click the Refresh button to take a new snapshot of the UI stack for inspection. The Layout Inspector now remembers your preference to keep Live updates enabled or disabled between sessions.

Android Gradle plugin support for Jetpack Compose

Starting with Android Gradle Plugin 4.2 Canary 13, only Jetpack Compose Compiler 1.0.0-alpha-04 and higher will be supported.

Upgrade Assistant for AGP

Starting in Android Studio 4.2 Canary 5, an Upgrade Assistant for Android Gradle plugin can help you update the AGP version for your project.

Android Gradle plugin Upgrade Assistant dialog

Built on top of the existing AGP upgrade functionality, this tool guides you through project-wide updates/refactorings and includes a preview of the updates to help prevent potential breaking changes before executing the AGP upgrade.

Preview of changes to be performed by Upgrade Assistant

Support for Safe Args

Safe Args is a Gradle plugin that generates simple object and builder classes for type-safe navigation and access to any associated arguments. Android Studio 4.2 Canary 9 and higher includes special support when working with Safe Args, as described below:

  • Autocompletions for Directions, Args, and the various builder classes
  • Support for both Java and Kotlin safe args plugins
  • Navigation from source to XML

Accessibility Scanner for Layout Editor

Android Studio now integrates with the Android Accessibility Test Framework to help you find accessibility issues in your layouts. When using the Layout Editor, click on the Accessibility Scanner Accessibility Scanner button button to launch the scanner. The tool also offers suggested fixes for some common problems such as missing content descriptions.

Accessibility Scanner is available starting in Canary 8.

Accessibility Scanner in Android Studio

Database Inspector

Query editor improvements

The Database Inspector includes some improvements to help you write and execute your custom SQL statements. When you open the inspector and open a New query tab, you should notice a larger, resizable editor surface to author and format your queries, as shown below.

DB Inspector editor

Additionally, we now provide a history of your previous queries. When you click on the Show query history Show query history button button, you should see a list of queries you previously ran against the currently selected database. Click a query in the list to see a preview of the full query in the editor and press Enter to copy it to the editor. Then, click Run to execute the statement.

Run command in query editor

Offline mode

In previous versions of Android Studio, disconnecting from an app process while using the Database Inspector resulted in closing the inspector and its data. In Android Studio 4.2 Canary 8 and higher, we've added the ability to keep inspecting your app's databases after a process disconnects, making it easier to debug your app after a crash.

When a disconnect occurs, the Database Inspector downloads your databases and then makes them available to you in offline mode. When offline, you can open tables and run queries.

Keep in mind, when you reconnect to a live app process, the Database Inspector returns to live mode and shows you only the data that is on the device. That is, data shown in offline mode doesn't persist when you reconnect to an app process. Because of this, the Database Inspector does not allow editing or running modification statements while in offline mode.

New removable setting for feature modules

Android Gradle plugin 4.2 uses bundletool 1.0.0, which introduces a behavior change for apps using feature modules: Any 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 feature module manifest.

This section provides a summary of the new features and changes in Android Studio 4.2.

Android Gradle plugin 4.2

Behavior change for files

Starting in AGP 4.2, it is no longer possible to override Gradle properties from subprojects. In other words, if you declare a property in a file in a subproject instead of the root project, it will be ignored.

As an example, in previous releases, AGP would read values from projectDir/, projectDir/app/, projectDir/library/, etc. For app modules, if the same Gradle property was present in both projectDir/ and projectDir/app/, the value from projectDir/app/ would take precedence.

In AGP 4.2, this behavior has been changed, and AGP won't load values from in subprojects (e.g., projectDir/app/ This change reflects the new Gradle behavior and supports configuration caching.

For more information on setting values in files, see the Gradle docs.

New JVM resource compiler

A new JVM resource compiler in Android Gradle plugin 4.2 tool replaces portions of the AAPT2 resource compiler, potentially improving build performance, especially on Windows machines.

Starting with the Canary 7 release, the new JVM resource compiler is enabled by default.

v3 and v4 signing now supported

Android Gradle Plugin 4.2 now supports APK v3 and APK v4 signing formats. To enable one or both of these formats in your build, add the following properties to your module-level build.gradle or build.gradle.kts file:


// build.gradle.kts

android {
   signingConfigs {
      config {


// build.gradle

android {
  signingConfigs {
    config {
        enableV3Signing true
        enableV4Signing true

APK v4 signing allows you to quickly deploy large APKs using the ADB Incremental APK installation in Android 11. This new flag takes care of the APK signing step in the deployment process.

Support for Jetpack Compose

Jetpack Compose toolkit provides a modern approach to building your app's UI. The toolkit also brings all of Kotlin's benefits, such as helping you to write concise and idiomatic code that's fully interoperable with Java.

For the best experience developing with Jetpack Compose, you should use the latest version of Android Studio 4.2. That's because when you use Android Studio to develop your app with Jetpack Compose, you can benefit from smart editor features, such as New Project templates and the ability to immediately preview your Compose UI.

To learn more and get started, go to the Jetpack Compose overview.

New Jetpack Compose tooling support in 4.2

Android Studio now includes additional support for previewing and testing apps that use Jetpack Compose.

Compose preview

The following parameters for @Preview methods are now available:

  • showBackground: Switch on and off a background for your preview.
  • backgroundColor: Set a color that is only used in the preview surface.
  • uiMode: This new parameter can take any of the Configuration.UI_* constants and allows you to change the behavior of the preview to, for example, set it to Night Mode to see how the theme reacts.

Interactive preview

In this mode, you can interact with your UI components, click them, and see how the state changes. It's a quick way to get feedback on how your UI reacts and to preview the animations. To enable it, just click the interactive icon and the preview will switch modes.

To stop, click the Stop Interactive Preview in the top toolbar.

Deploy to device

Use this feature to deploy a snippet of your UI to a device. This will help to test small parts of your code in the device without having to start the full application.

Click the deploy to device icon next to the @Preview annotation or in the top of the preview and Android Studio will deploy that @Preview to your connected device or emulator.

Preview Data Sources API

The new Data Sources API allows you to generate previews from your data. If you have an existing list of data, or a list of themes, this API will allow you to inject it as a parameter to the @Preview method.

class HelloWorldProvider :
       listOf("Hello World", "Привет мир", "Olá Mundo", "Hola Mundo"))

fun HelloWorldPreview(
   @PreviewParameter(HelloWorldProvider::class) text: String
) {
   MaterialTheme {
       Text(text = text)

To enable the above features, your module's build.gradle must contain the following settings:

  android {
  buildFeatures {
    compose true
  composeOptions {
     kotlinCompilerExtensionVersion = "0.1.0-dev13"
     kotlinCompilerVersion = "1.3.70-dev-withExperimentalGoogleExtensions-20200424"

Known issues for Compose preview is currently not supported in Compose preview.

Improved instrumentation testing

Starting in Android Studio 4.2 Canary 1, instrumentation tests can now be run across multiple devices in parallel and investigated using a specialized instrumentation test results panel. Using this panel, you can determine if tests are failing due to API level or hardware properties.

Instrumentation test panel

Testing your app across a wide variety of API levels and form factors is one of the best ways to ensure that all users have a great experience when using your app.

To take advantage of this feature:

  1. Select Modify Device Set in the target device dropdown menu (in the top-center of the IDE).

    Target device dropdown

  2. Select the target devices and click OK.

    Modify device set dialog

  3. Select Multiple Devices in the target device dropdown menu and run your tests.

    Select Multiple Devices from target device dropdown

To view your test results in the Run panel, go to View > Tool Windows > Run.

The new test results panel allows you to filter your test results by status, device, and API level. Additionally, you can sort each column by clicking the header. By clicking on an individual test, you can view logs and device information individually for each device.

Apply Changes

To help you be more productive as you iterate on your app, we've made the following enhancements to Apply Changes for devices running Android 11 or higher:

Support for additional code changes

For devices running Android 11 or higher, you can now add static final primitive fields and then deploy those changes to your running app by clicking either Apply Code Changes or Apply Changes and Restart Activity .

You can now also add resources and then deploy those changes to your running app on Android 11 devices by clicking Apply Changes and Restart Activity .

Known Issues for 4.2 Preview

This section describes current known issues in Android Studio 4.2 Preview.

Native Memory Profiler: Profiling app startup disabled

Profiling native memory on app startup has been disabled. This option will be enabled in an upcoming release.

As a workaround, you can use the Perfetto standalone command-line profiler to capture startup profiles.

Studio doesn’t start after installing Canary 8

After upgrading Android Studio to 4.2 Canary 8, the IDE may not start for certain users who set custom VM options in the .vmoptions file. To work around this issue, we recommend commenting out custom options in .vmoptions (using the “#” character). The .vmoptions file can be found in the following locations:




~/Library/Application Support/Google/AndroidStudioPreview4.2/studio.vmoptions