Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

New features in Android Studio Preview

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

Android Studio 3.3 is currently in the Beta channel.

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

This page provides a summary of the new features and changes in these preview versions.

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 3.4

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

Updated Project Structure dialog

Android Studio 3.3 Canary 4 introduces updates to the Project Structure dialog (PSD). Select File > Project Structure from the menu bar to manage how your project is configured using the following new features:

  • Visualize the actual structure of a project, as resolved by Gradle as a project sync. For example, you can visualize the dependency graph of each module.
  • Get notifications when new versions of your library dependencies are available.
  • Configure a project through the dialog UI, without manually editing build.gradle files.

Re-import Gradle project

If a library does not appear in Android Studio, you can now re-import the Gradle project by selecting File > Re-Import Gradle Project.

When Android Studio syncs a project for the first time, it downloads Gradle project dependencies. If the linked libraries are not successfully downloaded, Android Studio will not look for those sources again during subsequent sync operations. Not scanning during sync operations was necessary to improve the performance of Gradle sync, but might cause Android Studio to not be able to open sources for the missing libraries.

Android Studio 3.3

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

Profiler memory allocation tracking options

To improve app performance while profiling, you can now choose a mode for live memory allocation tracking on devices running API level 26 or higher.

Using the Allocation Tracking dropdown, you can choose from the following modes:

  • Full: captures all object memory allocations. Note that if you have an app that allocates a lot of objects, you might see significant performance issues while profiling.
  • Sampled: captures a periodic sample of object memory allocations. This is the default behavior and has less impact on app performance while profiling. You might encounter some performance issues with apps that allocate a lot of objects within a short time period.
  • Off: turns memory allocation off. This mode is enabled automatically while taking a CPU recording. You can change this behavior in the CPU recording configuration dialog.

Inspect frame rendering data

In the CPU profiler, you can now inspect how long it takes your Java app to render each frame on the main UI thread and RenderThread. This data might be useful when investigating bottlenecks that cause UI jank and low framerates. For example, each frame that takes longer than the 16ms required to maintain a smooth framerate is displayed in red.

To see frame rendering data, record a trace using a configuration that allows you to Trace System Calls. After recording the trace, look for info about each frame along the timeline for the recording under the section called FRAMES, as shown below.

To learn more about investigating and fixing framerate issues, read Slow rendering.

CMake version 3.10.2

CMake version 3.10.2 is now included with SDK Manager. Note that Gradle still uses version 3.6.0 by default.

To specify a CMake version for Gradle to use, add the following to your module’s build.gradle file:

android {
    ...
    externalNativeBuild {
        cmake {
            ...
            version "3.10.2"
        }
    }
}

For more information on configuring CMake in build.gradle, see Manually configure Gradle.

New “+” syntax to specify minimum CMake versions

When specifying a version of CMake in your main module’s build.gradle file, you can now append a “+” to match the behavior of CMake’s cmake_minimum_required() command.

Delete unused directories dialog

When a new major version of Android Studio is run for the first time, it looks for directories containing caches, settings, indices, and logs that are associated with older versions of Android Studio for which a corresponding installation can’t be found. When found, a dialog displays their locations, sizes, and last-modified times, and provides an option to delete them.

The directories considered for deletion are listed below:

  • Linux: ~/.AndroidStudio[Preview]_X.Y_
  • Mac: ~/Library/{Preferences, Caches, Logs, Application Support}/AndroidStudio[Preview]_X.Y_
  • Windows: %USER%\.AndroidStudio[Preview]_X.Y_

IntelliJ IDEA 2018.2.2

The core Android Studio IDE has been updated with improvements from IntelliJ IDEA through the 2018.2.2 release.

Android App Bundles now support Instant Apps

Android Studio now includes support for building Android App Bundles with full support for Instant Apps. In other words, you can now build and deploy both installed app and Instant App experiences from a single Android Studio project, and include them in a single Android App Bundle.

If you’re creating a new Android Studio project using the Create New Project dialog, make sure you check the box next to Configure your project > This project will support instant apps. Android Studio then creates a new app project as it normally would, but includes the following properties in your manifest to add Instant app support to your app’s base module:

<manifest ... xmlns:dist="http://schemas.android.com/apk/distribution">
    <dist:module dist:instant="true" />
    ...
</manifest>

You can then add dynamic feature modules that are instant app-enabled by selecting File > New > New Module from the menu bar and then selecting Instant Dynamic Feature Module from the Create New Module dialog.

If you already have a project that supports Dynamic Delivery, you can still add instant app-enabled dynamic features using the New Module wizard, as described above. However, keep in mind that doing so also enables instant app support for your app’s base module.

To deploy your app to a local device as an instant app, edit your run configuration and check the box next to General > Deploy as instant app.

Support for Clang-Tidy

Android Studio now includes support for static code analysis using Clang-Tidy for projects that include native code. To enable support for Clang-Tidy, you need to update your NDK to r18 or higher.

You can then enable or re-enable the inspections by opening the Settings or Preferences dialog, navigating to Editor > Inspections > C/C++ > General > Clang-Tidy. When selecting this inspection in the Settings or Preferences dialog, you can also see the list of Clang-Tidy checks the IDE enables and disables by default under the Option section of the right-most panel. To enable additional checks, simply add them to the list and click Apply.

To configure Clang-Tidy with additional options, click Configure Clang-Tidy Checks Options and add them in the dialog that opens.

Updates to the build system

Android Gradle plugin 3.3.0 requires Gradle 4.10 or higher, and includes the following updates.

New default SDK Build Tools version

The Android Gradle plugin now uses SDK Build Tools version 28.0.3 by default.

Improved incremental Java compilation when using annotation processors

This update decreases build times by improving support for incremental Java compilation when using annotation processors.

  • For projects that include Kotlin code: Incremental Java compilation is enabled by default, even if your project uses the data-binding or retro-lambda plugin.
  • For Java-only projects:

    • If the annotation processors you use all support incremental annotation processing, incremental Java compilation is enabled by default.
    • If, however, one or more annotation processors do not support incremental builds, incremental Java compilation is not enabled. Instead, you can include the following flag in your gradle.properties file:

      android.enableSeparateAnnotationProcessing=true

      When you include this flag, Gradle executes the annotation processors in a separate task and allows the Android plugin to enable incremental mode for the Java compilation task.

Improved classpath dependency synchronization

When resolving dependencies on your runtime and compile time classpaths, the Android Gradle plugin attempts to fix certain downstream version conflicts for dependencies that appear across multiple classpaths.

For example, if the runtime classpath includes Library A version 2.0 and the compile classpath includes Library A version 1.0, the plugin updates the dependency on the compile classpath to Library A version 2.0 to avoid errors.

However, if the runtime classpath includes Library A version 1.0 and the compile includes Library A version 2.0, the plugin does not downgrade the dependency on the compile classpath to Library A version 1.0, and you still get an error.

Lazy task configuration

The Android Gradle plugin now uses a new task configuration API, which avoids the cost of creating and configuring tasks during Gradle’s configuration phase when those tasks are not going to be executed. This lets the plugin do less work when building just one of many variants in each module.

The Android Gradle plugin’s Variant API includes many task getters, such as variant.getJavaCompile(), that do not implement Gradle’s new task configuration APIs and always trigger the configuration of the task. Please use one of the newer getter APIs that return a TaskProvider instead, such as variant.getJavaCompileProvider().

To learn more about Gradle’s new API and how to migrate to it, read Task Configuration Avoidance.

Show Gradle Daemons dialog

You can now view a list of active Gradle daemons in Android Studio. To do this, double-press the Shift key to bring up the Search Everywhere dialog, type "Show Gradle Daemons", and click on the Show Gradle Daemons result that appears.

R8 enabled by default

R8 is a new tool for code shrinking and obfuscation that replaces ProGuard, and it's enabled by default. If you experience issues with R8, please report a bug. You can disable R8 by adding the following to your project’s gradle.properties file:

android.enableR8 = false

Single-variant project sync

Syncing your project with your build configuration is an important step in letting Android Studio understand how your project is structured. However, this process can be time-consuming for large projects. If your project uses multiple build variants, you can now optimize project syncs by limiting them to only the variant you have currently selected.

You need to use Android Studio 3.3 Canary 6 or higher with Android Gradle Plugin 3.3.0-alpha06 and higher to enable this optimization. When you meet these requirements, the IDE prompts you to enable this optimization when you sync your project.

To enable this optimization manually, click File > Settings > Experimental > Gradle (Android Studio > Preferences > Experimental > Gradle on a Mac) and check Only resolve selected variants.

Better debug info when using obsolete API

When the plugin detects that you're using an API that's no longer supported, it can now provide more-detailed information to help you determine where that API is being used. To see the additional info, you need to include the following in your project's gradle.properties file:

android.debug.obsoleteApi=true

You can also enable the flag by passing -Pandroid.debug.obsoleteApi=true from the command line.

Provide quick feedback

If you've opted into sharing usage statistics to help improve Android Studio, you'll see these two new icons in the status bar at the bottom of the IDE window:

Simply click the icon that best represents your current experience with the IDE. When you do so, the IDE sends usage statistics that allow the Android Studio team to better understand your sentiment. In some cases, such as when you indicate a negative experience with the IDE, you'll have an opportunity to provide additional feedback.

If you haven't already done so, you can enable sharing usage statistics by opening the Settings dialog (Preferences on a Mac), navigating to Appearance & Behavior > System Settings > Data Sharing, and checking Send usage statistics to Google.

Removal of options for C++ customization

The following options have been removed from the Customize C++ Support dialog:

  • Exceptions Support (-fexceptions)
  • Runtime Type Information Support (-ftti)

The respective behaviors are enabled for all projects created through Android Studio.