Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

on my colleague's system. As far as I know only the android studio version is different. Is it possible that if I hadn't upgraded my android studio to "2.3.Beta 2" I could still build with 23.0.3?

like image 803
Shyamnath Mallinathan Avatar asked Jan 27 '17 09:01

Shyamnath Mallinathan


People also ask

How do I update Android SDK?

Open the Preferences window by clicking File > Settings (on Mac, Android Studio > Preferences). In the left panel, click Appearance & Behavior > System Settings > Updates. Be sure that Automatically check for updates is checked, then select a channel from the drop-down list (see figure 1). Click Apply or OK.

How do I download SDK version 31?

Install the SDKClick Tools > SDK Manager. In the SDK Platforms tab, select Android 12. In the SDK Tools tab, select Android SDK Build-Tools 31. Click OK to install the SDK.


3 Answers

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()
    }
}
like image 186
isabsent Avatar answered Oct 04 '22 04:10

isabsent


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.

like image 5
Mudassir Khan Avatar answered Oct 04 '22 05:10

Mudassir Khan


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.

like image 3
Eugen Pechanec Avatar answered Oct 04 '22 05:10

Eugen Pechanec