skip to Main Content

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?

4

Answers


  1. 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"
    
    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. put this line in your build.gradle(project) file

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

    Login or Signup to reply.
  4. 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 androidgradlewrappergradle-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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search