简体   繁体   中英

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

heres the android studio details im using

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:-

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:-

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".

is this a known feature of android studio?

how can i remove this warning?

put this line in your build.gradle(project) file

classpath "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

Tools-> SDK manager -> Android SDK -> (select the version you want here) -> ok -> ok -> wait for the installation to finish, and voila, you're done

also try to put a higher version of the bulid.gradle file like: classpath 'com.android.tools.build:gradle:7.1.3'

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

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

Go to build.gradle

If you are using latest try to put a lower version of the bulid.gradle file like:

classpath 'com.android.tools.build:gradle:7.0.0'

then run the project. it works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM