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..."
Asked Answered
F

10

43

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?

Flapdoodle answered 15/12, 2021 at 17:49 Comment(1)
Either remove buildToolsVersion "32.0.0" or add an compatible build tool version buildToolsVersion "31.0.0" since you are using compileSdkVersion 31Wavelength
R
31

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

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

Reber answered 18/4, 2022 at 9:0 Comment(2)
If you use 7.1.3 then you need to update its distribution URL to the following in the gradle-wrapper.propertise file, too. distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zipMantelpiece
This produces a much more fatal unresolvable error: It is too late to modify excludes ...Ryals
K
10

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'

Put this line in your build.gradle(project)

classpath "com.android.tools.build:gradle:7.1.3"
Katherinakatherine answered 22/3, 2022 at 3:29 Comment(0)
Q
4

I was running into this issue in my Flutter application. For me, the fix didn't require changing any configuration. I just needed to open the android folder on Android Studio and wait for it to sync. After the sync it was working again!

Quass answered 15/10, 2023 at 10:34 Comment(1)
Similarly, flutter clean before running build fixed it for me.Margarita
A
2

I was trying to run old project after the complete update of my flutter development environment and I was having same issue: The given solutions work for me but i want to add somthing more about this answers: As its the problem of version you can create a new project and Go to android/build.gradle of new project and copy

classpath 'com.android.tools.build:gradle:(new created project) and paste this in your previous project which is creating this issue of version

also same for this Go to android\gradle\wrapper\gradle-wrapper.properties

distributionUrl=https://services.gradle.org/distributions/(new created project).zip

and paste this in your previous project which is creating this issue of version

this is just addition of given answers . by this you will update your project just according to you development environment. Its work for me I hope it will work your you too.

Ampulla answered 22/3, 2023 at 4:45 Comment(0)
C
1

It works for me when I click "Repair IDE" in the Android Studio.

Castorena answered 28/5 at 8:36 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Brigidabrigit
T
1

In my flutter app terminal

Warning: SDK processing. 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.

Solution:

android/settings.gradle

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version '7.3.0' apply false
    id "org.jetbrains.kotlin.android" version "1.8.0" apply false
}

to

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version '7.4.2' apply false. <--- this row
    id "org.jetbrains.kotlin.android" version "1.8.0" apply false
}
Theorbo answered 4/6 at 3:6 Comment(0)
F
1

you only need check the maxSDK in your buil.gradle(app) and check your maxSDK in your Manifest, ang change only one for to have the same in the two docs

Fan answered 8/6 at 18:1 Comment(0)
A
0

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.

Arkose answered 14/4, 2022 at 10:16 Comment(0)
C
0

I left a space when creating the project file. There were other problems too. I am a beginner :)

Chloramine answered 26/5 at 17:12 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Siddra
H
0

I faced same issue but got resolved and emulator got started [Make sure you install Android SDK Build-Tools 35-rc4]

CLICKME

Hudspeth answered 11/6 at 11:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.