skip to Main Content

Whenever I build the React application, it automatically selects version 8.2.1, which is not specified, and also picks the latest SDK version. As a result, the build keeps failing.

Android gradle plugin: 8.2.1 Gradle: 8.0.1 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. WARNING: The specified Android SDK Build Tools
version (33.0.0) is ignored, as it is below the minimum supported
version (34.0.0) for Android Gradle Plugin 8.2.1. Android SDK Build
Tools 34.0.0 will be used.

/android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33

        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
    }
}

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-8.0.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2

Answers


  1. Your Gradle version does not match the SDK version, this is just a warning message and can be ignored if the version difference is not too large.

    If you want to fix it, you can continue down the page

    
    // Specify the Gradle version for your android project
    
    classpath("com.android.tools.build:gradle:$version")
    

    or

    // kotin dsl
    plugins {
        id("com.android.application") version "$version" apply false
    }
    

    How do I check that the plugin matches the version of the SDK? You just need to focus on their release dates.

    See: Android SDK releases , Android Gradle plugin releases


    This is My build config
    SDK: 35, APG: 8.5.0

       // Sdk
       compileSdk = 35
       targetSdk = 35
       buildToolsVersion = "35.0.0"
    
       // Android Gradle Plugin(AGP)
       plugins {
         id("com.android.application") version "8.5.0" apply false
       }
    
    Login or Signup to reply.
  2. If you received this warning in a flutter project. If you get this warning in Android Studio(Maybe there is a solution with similar settings in vs code, and maybe intellij idea also has a similar solution), apply the suggested Android versions on (etc.build.gradles) by clicking on the yellow underlined codes in the configuration settings and the suggested light. Then search for the "flutter clean" item in the properties in the lower left corner and run it (it may be somewhere else, I don’t remember exactly). Then click "sync now" in the logcat section to finish the fixes. After these operations, the warning should no longer appear. Of course, this was just a solution for me.

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