Error:The SDK Build Tools revision (23.0.3) is too low for project ':app'. Minimum required is 25.0.0

前端 未结 6 1915
天涯浪人
天涯浪人 2020-12-07 18:06

The title is a duplicate but my question is different.

The same project works fine and is allowed to be built on

buildToolsVersion 23.0.3

相关标签:
6条回答
  • 2020-12-07 18:16

    You have to change top-level build.gradle from

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.0'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
    //        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    

    to:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.3'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
    //        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    
    0 讨论(0)
  • 2020-12-07 18:19

    Ok I found a solution to this.

    For people facing the same problem in the future, here's what I did:

    I added the following to my root build gradle android/build.gradle (Not the android/app/build.gradle)

    subprojects {
        afterEvaluate {project ->
            if (project.hasProperty("android")) {
                android {
                    compileSdkVersion 25
                    buildToolsVersion '25.0.0'
                }
            }
        }
    }
    

    That forces all the submodules to use the specified compileSdkVersion and buildToolsVersion. Problem gone now.

    0 讨论(0)
  • 2020-12-07 18:26

    Yes u can do 2.3 studio is upto 25 supported you want to install sdk 19to25 in studio

    0 讨论(0)
  • 2020-12-07 18:29

    if I hadn't upgraded my android studio to "2.3.Beta 2" I could still build with 23.0.3?

    Yes.

    You can still run the build process from command line with any version of build tools.

    Feel free to upgrade build tools to 25.0.2 (latest as of 27.1.2017). This only affects build process, it doesn't affect the app behavior.

    Newer versions of build tools incorporate more options and newer technologies and newer versions of Android Studio depend on these technologies.

    0 讨论(0)
  • 2020-12-07 18:33

    I solved this issue:

    added this code in android/build.gradle

    ```

    subprojects {
        afterEvaluate {project ->
            if (project.hasProperty("android")) {
                android {
                    compileSdkVersion 26
                    buildToolsVersion '26.0.0'
                }
            }
        }
    }
    

    ```

    0 讨论(0)
  • 2020-12-07 18:38

    Setting classpath 'com.android.tools.build:gradle:1.+' can resolve my problem when my project migrated from Android Studio 1.5.0 to 2.3.0.

    0 讨论(0)
提交回复
热议问题