What is the API level of Android R/11 to set in build.gradle in Android Studio?

Pooja Singh :

I can use API R via Android Studio Emulator. I know I can run directly from Android Studio but still I want to set in Gradle level.

android {
    compileSdkVersion 30
    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
Ryan Mentley :

From the preview documentation, the compile SDK version is 'android-R' and the target SDK version is 'R':

android {
    compileSdkVersion 'android-R'

    defaultConfig {
        targetSdkVersion 'R'
        // ...
    }
    // ... 
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=15552&siteId=1