New features in Android Studio Preview

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

Android Studio 3.6 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 3.6

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

Apply Changes

You can now add a class and then deploy that code change to your running app by clicking either Apply Code Changes Apply Code Changes icon or Apply Changes and Restart Activity Apply Changes icon.

To learn more about the difference between these two actions, see Apply Changes.

NDK updates

The following updates support native (C/C++) development in Android Studio.

Kotlin support

The following NDK features in Android Studio, previously supported in Java, are now also supported in Kotlin:

  • Navigate from a JNI declaration to the corresponding implementation function in C/C++. View this mapping by hovering over the C or C++ item marker near the line number in the managed source code file.
  • Automatically create a stub implementation function for a JNI declaration. Define the JNI declaration first and then type “jni” or the method name in the C/C++ file to activate.

  • Unused native implementation functions are highlighted as a warning in the source code. JNI declarations with missing implementations are also highlighted as an error.

  • When you rename (refactor) a native implementation function, all corresponding JNI declarations are updated. Rename a JNI declaration to update the native implementation function.

  • Signature checking for implicitly-bound JNI implementations.

Other JNI improvements

  • Cosmetics

    • Type hints for parameter and return values are shown in JNI implementation functions.
    • JNI-mangled function names can be folded.

  • RegisterNatives support

    • Auto-completion for the method declaration name, parameter types, and return type.

    • Rename refactoring of the method declaration name.

    • Signature-checking for bound JNI functions.

  • Other JNI function assistance

    • Auto-completion, inspection, navigation, and rename refactoring support for string literals in the following:
      • FindClass
      • GetMethodID and GetStaticMethodID
      • GetFieldID and GetStaticFieldID
    • Various inspections for the following:
      • Call[Static]<type>Method
      • CallNonvirtual<type>Method
      • Get[Static]<type>Field
      • NewObject

Support for the Maven Publish plugin

Android Gradle plugin 3.6-alpha07 and higher includes support for the Maven Publish Gradle plugin, which allows you to publish build artifacts to an Apache Maven repository. The Android Gradle plugin creates a component for each build variant artifact in your app or library module that you can use to customize a publication to a Maven repository.

The components that the Android plugin creates depend on whether the module uses the application or library plugin, as described in the table below.

Android Gradle plugin Publication artifact Component name AAR components.variant A ZIP of APK(s), and available ProGuard or R8 mappings files components.variant_apk An Android App Bundle (AAB) components.variant_aab

The following code sample creates a publication for the release and debug build variants of an AAR library. Each publication applies the matching component and customizes attributes of the generated POM, such as the Maven coordinates.

// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            release(MavenPublication) {
                // Applies the component for the release build variant.
                from components.release

                // You can then customize attributes of the publication as shown below.
                groupId = 'com.example.MyLibrary'
                artifactId = 'final'
                version = '1.0'
            // Creates a Maven publication called “debug”.
            debug(MavenPublication) {
                // Applies the component for the debug build variant.
                from components.debug

                groupId = 'com.example.MyLibrary'
                artifactId = 'final-debug'
                version = '1.0'

To create a publication that publishes your app as either a ZIP file of APKs or an Android App Bundle (AAB), simply use the appropriate component, as shown below.

afterEvaluate {
    publishing {
        publications {
            paidRelease(MavenPublication) {
              // The following applies a component to this publication
              // which results in publishing an app bundle.
              from components.paidRelease_aab

              groupId = 'com.example.MyApp'
              artifactId = 'paid-release-aab'
              version = '1.0'
            paidDebug(MavenPublication) {
              // The following applies a component to this publication
              // which results in publishing APKs in a ZIP file.
              from components.paidDebug_apk

              groupId = 'com.example.MyApp'
              artifactId = 'paid-debug-apks'
              version = '1.0'

After you create publications, the Maven Publish plugin creates publishing tasks that you can use to publish your artifact to the repositories that you specify.

IntelliJ IDEA 2019.2

The core Android Studio IDE has been updated with improvements from IntelliJ IDEA through the 2019.2 release, such as the Services tool window.

To learn more about the improvements from other IntelliJ versions that are included cumulatively with version 2019.2, see the following pages: