简体   繁体   English

Why am I getting this warning and how to resolve it "This version only understands SDK XML versions up to 2 but an SDK XML..."

[英]Why am I getting this warning and how to resolve it "This version only understands SDK XML versions up to 2 but an SDK XML..."

I have just updated my current android application to use java 11, build tools 32.0.0 and我刚刚更新了我当前的 android 应用程序以使用 java 11,构建工具 32.0.0 和

heres the android studio details im using继承人 android 工作室详细信息我正在使用

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)

now im seeing this build warning现在我看到这个构建警告

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.

my gradle resembles this:-我的 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
}

my app gradle resembles this:-我的应用 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"
    }

I searched my entire code base and cannot find any xml version other that "1.0".我搜索了整个代码库,找不到除“1.0”以外的任何 xml 版本。

is this a known feature of android studio?这是 android 工作室的已知功能吗?

how can i remove this warning?我怎样才能删除这个警告?

put this line in your build.gradle(project) file将此行放入您的 build.gradle(project) 文件中

classpath "com.android.tools.build:gradle:7.1.3"类路径“com.android.tools.build:gradle:7.1.3”

just update the emulator to a newer version (from 9th to 12th) https://developer.android.com/studio/known-issues#ki-android-11-db-inspector只需将模拟器更新到较新的版本(从第 9 版到第 12

Tools-> SDK manager -> Android SDK -> (select the version you want here) -> ok -> ok -> wait for the installation to finish, and voila, you're done工具-> SDK 管理器-> Android SDK -> (在这里选择你想要的版本) -> ok -> ok -> 等待安装完成

also try to put a higher version of the bulid.gradle file like: classpath 'com.android.tools.build:gradle:7.1.3'还尝试放置更高版本的 bulid.gradle 文件,例如:classpath 'com.android.tools.build:gradle:7.1.3'

поместите эту строку в файл build.gradle(project) поместите эту строку в файл build.gradle(project)

classpath "com.android.tools.build:gradle:7.1.3"

Go to build.gradle Go 至 build.gradle

If you are using latest try to put a lower version of the bulid.gradle file like:如果您使用的是最新版本,请尝试放置较低版本的 bulid.gradle 文件,例如:

classpath 'com.android.tools.build:gradle:7.0.0'类路径'com.android.tools.build:gradle:7.0.0'

then run the project.然后运行项目。 it works for me.这个对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我只得到 <?xml version=“1.0” standalone=“no”?> 什么时候要求xml文件? 安卓系统 - Why am I only getting <?xml version=“1.0” standalone=“no”?> when request for a xml file? Android 无法解析 setLatestEventInfo 我使用的 sdk 版本是 23 - Cannot resolve setLatestEventInfo the sdk version i am using is 23 Android:如何忽略已定义的Android SDK版本以下的xml元素? - Android : how to ignore an xml element below a defined Android SDK version? 在安装 android studio 时,为什么我总是收到未找到/下载 sdk 文件的错误??以及如何解决这个问题? - While installing android studio why do i keep getting the error that sdk files not found/downloaded??and how to resolve this? 在Android XML中内联SDK版本检查? - Inline sdk version check in Android XML? Android SDK和AVD Manager仅显示最新版本(不显示版本5或6)? - Android SDK and AVD Manager only shows latest version (not showing versions 5 or 6)? 如何在android sdk中将dom元素序列化为xml? - How can I serialize a dom element to xml in the android sdk? 如何重用Android SDK中的代码进行XML解析 - How can I reuse code from the android sdk for XML Parsing AndroidManifest.xml文件丢失! 我为什么得到这个? - AndroidManifest.xml file missing! Why am I getting this? 为什么我无法安装Android SDK? - Why am I not able to install Android SDK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM