Set up the Android 18 SDK

To develop with Android 18 APIs and test your app with the Android 18 behavior changes, you need to set up the Android 18 SDK. Follow the instructions on this page to set up the Android 18 SDK in Android Studio and build and run your app on Android 18.

Get Android Studio

The Android 18 SDK includes changes that are not compatible with some lower versions of Android Studio. For the best development experience with the Android 18 SDK, use the latest preview version of Android Studio (minimum version: Android Studio Rabbit 3 | 2026.2.3 RC 2). Remember that you can keep your existing version of Android Studio installed, as you can install multiple versions side-by-side.

Get Android Studio

Update your app's build configuration

To access Android 18 APIs, open your app's build.gradle or build.gradle.kts file and update the compileSdkPreview for Android 18 as follows:

Kotlin

android {
    compileSdkPreview = "Dev"
}

Groovy

android {
    compileSdkPreview = "Dev"
}

Android Studio can provide contextual information about the behavior changes through the Android SDK Upgrade Assistant. Once you're ready to opt in to the new runtime behaviors for Android 18, update your app's targetSdkPreview as follows:

Kotlin

android {
    defaultConfig {
        targetSdkPreview = "Dev"
    }
}

Groovy

android {
    defaultConfig {
        targetSdkPreview = "Dev"
    }
}

Manually install the SDK

Within Android Studio, you can install the Android 18 SDK as follows:

  1. Click Tools > SDK Manager.
  2. In the SDK Platforms tab, expand the Android Dev Preview section and select the Android SDK Platform Dev package.
  3. In the SDK Tools tab, expand the Android SDK Build-Tools 38 section and select the latest 38.x.x version. These labels might have a suffix such as rc1 or rc2.
  4. Click OK to install the SDK.

Next steps

To learn about the changes that might affect your app, and to learn how to test these changes in your app, read the following sections:

To learn more about new APIs and features available in Android 18, read New features and APIs.