简体   繁体   中英

How to set the minimum SDK Build Tools version required in an Android Studio project?

When I try to run my React Native project in the Android emulator I get the following error:

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

My android/app/build.gradle file specifies:

buildToolsVersion "23.0.1"

On Android Studio, it also logs the same error for each of the packages I'm using:

Android Studio中的错误

I believe this started happening after I inadvertently updated some stuff that Android Studio suggested.

All the build.gradle files that I've checked specify version 23.0.1 , but for some reason 25.0.0 seems to be overriding that setting.

How do I go about correcting this?

Ran into this issue and realized that the error is quite vague. Coming from an iOS background into React Native, I've had to learn a lot more about the Android ecosystem. The problem is that your project Gradle version is too high.

In your project's (top level) build.gradle you may be using:

classpath 'com.android.tools.build:gradle:2.3.1'

Gradle v2.3.1, implicitly sets the minimum SDK Build Tools revision to 25.0.0.

To fix, you can simply revert back to:

classpath 'com.android.tools.build:gradle:2.2.3'

This will allow your project's modules to use buildToolsVersions 23.0.1 or 25.0.2

  1. Install required Build Tools version 25.0.0
  2. Update buildToolsVersion in build.gradle file and sync project
  3. Set compileSdkVersion 25 and targetSdkVersion 25
  4. Clean and Build your project again
  5. Finally, Run on device

Hope this will help~

May be you are updated your studio version and open your old project if you do that then you want to go to package explorer app and right click on it and open modual setting one window open then select the project and set the Gradle version and android plugin version

example My studio version is 2.3 then Gradle version = 3.3 and Android plugin version = 2.3.0

if you not find then create new project blank project and see the setting and apply on your project

Android SDK Build Tools are required to build Android apps (see https://developer.android.com/studio/command-line/index.html#tools-build ). It's recommended to always use the latest version.

In your case react* libraries aren't compatible with current build tools version (23.0.1) so you need to upgrade (25.0.2 is the latest version at the moment).

The version is specified in build.gradle of your module. After syncing project everything would be fine or an error will be displayed that will suggest installing the missing version. Android Studio will do that for you.

android {
  ...
  buildToolsVersion "25.0.2"

在SDK Manager和Sync 23.0.1中卸载所有新版本的“ Android SDK Build-Tools”版本,然后仅对该项目尝试重试...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM