我刚刚更新了我当前的 android 应用程序以使用 java 11、构建工具 32.0.0,这是我使用的 android studio 详细信息Android Studio Bumblebee | 2021.1.1 Beta 5Build #AI-211.7628.21....
我刚刚更新了我当前的 android 应用程序以使用 java 11、构建工具 32.0.0 和
以下是我使用的 Android Studio 详细信息
Android Studio Bumblebee | 2021.1.1 Beta 5
Build #AI-211.7628.21.2111.7956428, built on November 30, 2021
Runtime version: 11.0.11+0-b60-7590822 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40)
现在我看到这个构建警告
Warning: This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
我的 gradle 类似于此:-
buildscript {
ext.kotlin_version = "1.6.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.40.5'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的应用程序 Gradle 类似于此:-
android {
compileSdkVersion 31
buildToolsVersion "32.0.0"
defaultConfig {
applicationId "com.my.app"
minSdkVersion 26
targetSdkVersion 31
versionCode 3
versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
我搜索了整个代码库,找不到除“1.0”之外的任何 xml 版本。
这是 Android Studio 的一个已知功能吗?
我怎样才能消除这个警告?
任何可能经历过类似事情的人,这是我的警告
Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
更新至
Android Studio Koala | 2024.1.1 Patch 1
解决方案是更新 android sdk 命令行工具。SDK 管理器 -> 语言和框架 -> android sdk -> sdk 工具(选项卡)-> android sdk 命令行工具项