![](/img/trans.png)
[英]build.gradle Project Level Showing Unreadable Format ANDROID STUDIO
[英]What is the API level of Android R/11 to set in build.gradle in Android Studio?
我可以通過 Android Studio Emulator 使用 API R。 我知道我可以直接從 Android Studio 運行,但我仍然想在 Gradle 級別進行設置。
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.example.test"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
現在 Android 11(也稱為 Android R)SDK 發布了,編譯 SDK 版本只是30
:
android {
compileSdkVersion 30
defaultConfig {
targetSdkVersion 30 // Optional: If you want to target R as well
// ...
}
// ...
}
不再適用:
當 Android R 處於預覽階段時,編譯 SDK 版本為'android-R'
,目標 SDK 版本為'R'
:
android { compileSdkVersion 'android-R' defaultConfig { targetSdkVersion 'R' // Optional: If you want to target R as well // ... } // ... }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.