91

What causes following problem? Is my Android SDK Version not supported?

Starting JS server...                                                                     
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

FAILURE: Build failed with an exception.                                                  

* What went wrong:                                                                        
A problem occurred configuring project ':app'.                                            
> failed to find Build Tools revision 23.0.1       
1
  • From v25 of SDK manager you now have to install the correct Build Tool from Android Studio because the android command is removed: stackoverflow.com/a/44295114/82609 Commented May 31, 2017 at 21:41

11 Answers 11

135

Probably you need to update your Build Tools.

I faced the problem when I tried to update from the graphic interface, it didn't show the exact minor version, so I couldn't update to it.

It was solved by looking at the available versions from the terminal with:

android list sdk -a

[...]
Packages available for installation or update: 156
1- Android SDK Tools, revision 24.4
2- Android SDK Platform-tools, revision 23.0.1
3- Android SDK Platform-tools, revision 23.1 rc1
4- Android SDK Build-tools, revision 23.0.1

[...]

And installing the right version with:

android update sdk -a -u -t 4
Sign up to request clarification or add additional context in comments.

5 Comments

What is this android program? Where do I get it?
@jameshfisher it's part of the Android SDK, it's located at the "tools" directory for example: ~/android-sdk/tools/android
I tried updating with Android Studio several times, but it never worked. This command did though. Thank you.
It is in android-sdk-linux in react project actually.
Note in new versions of SDK manager the android command does not work anymore and one has to run Android Studio to access this setting see stackoverflow.com/a/44295114/82609
73

Just a note - it's possible to get this error because the only version of the build tools you have installed is too new.

I got precisely the error that the OP got (complaining that react-native couldn't find Build Tools revision 23.0.1). When I checked my Android SDK Manager, I saw this:

screenshot showing 23.0.2 "Installed" but 23.0.1 "Not installed"

I'd naively thought that installing the latest version of the Build-tools (23.0.2 at the time of writing) would work, but apparently not. Additionally installing 23.0.1 fixed the problem.

3 Comments

same problem here. isn't there a way to use newer build tools? maybe some configuration.
This suggestion worked for me as well. 23.0.2 was too new, go figure. Thanks.
@boatcoder this answer (install older build tools) is no less correct than sodik's (modify build.gradle to make React Native use newer build tools). Android Build Tools seem to follow SemVer, so modifying build.gradle to use a later patch or minor version should usually be safe, may provide some platform-level bugfixes or performance improvements, and spares you having to download anything. But it will break your app if done on a major version release, and introduces some risk even with patch/minor releases since you're using RN with build tools that Facebook did not intend.
29

I also had problem with newer version of SDK Build tools (same as Mark) but I managed to resolve it with modification of android/app/build.gradle and setting proper version, e.g.

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
...

UPDATE: As Mark suggested, it is wise only update minor (or patch) version in this way. Another reason why not to update this version is when you have plenty of 3rd party libs with native part - you might end up updating all of them. So you must weight possible benefits of newer version vs a bit more work.

4 Comments

don't forget to change line 85 targetSdkVersion 22 to targetSdkVersion 23 as well.
I found that the generated build.gradle file had buildToolsVersion "23.0.1" but I only had version 23 (23.0.0) installed - Not sure where the "react-native init" finds the android/tools SDK version numbers from. So the cause is actually that the react-native init command is not using the available tools version number ?
I believe 23.0.1 is fixed (maybe can change with RN versions) but there is no detection afaik.
Thanks, this solved my problem, Changed from 23 to 25 and 23.0.1 to 25.0.0
4

Need modify 4 files

grep buildToolsVersion * -r | grep 23.0.1

Examples/Movies/android/app/build.gradle:    buildToolsVersion "23.0.2"
Examples/UIExplorer/android/app/build.gradle:    buildToolsVersion "23.0.2"
ReactAndroid/build.gradle:    buildToolsVersion "23.0.2"
local-cli/generator-android/templates/src/app/build.gradle:    buildToolsVersion "23.0.2"

Comments

3

I had to change my Android project's build.gradle to:

compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.demoproject"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

Comments

3

It means that the Android Build Tools installed on your system is something else than in your app's configuration file (your configuration file is pointing to 23.0.1) but you probably have 23, 24 or 25.0.* on your system.

The solution to fixing this problem:

  1. Edit the build.gradle file located under anroid/app in your project folder
  2. Look for the entry buildToolsVersion "23.0.1", and replace it with the latest version you have on your system. You can find it here: C:\Program Files (x86)\Android\android-sdk\build-tools

OR you could try to install in your system the version that you have in the build.gradle file (with SDK manager).

Comments

1

From Android SDK manager v25 you have to install the correct build tools directly from Android Studio because the android command does not work anymore:

install from android studio

1 Comment

To get to this screen from within Andriod Studio. file -> settings -> Android SDK -> SDK Tools -> bottom right "Show Package Details" I added this comment as it took me a while to find it.
1

Find the version number in the /Users/username/Library/Android/sdk/build-tools directory, and then modify the version number of the buildToolsVersion corresponding to the Gradle configuration

Comments

1

If you have Build Tools version 24.0.1, then update your build.gradle to match buildToolsVersion "24.0.0"

My Android/Sdk/build-tools/24.0.1/source.properties had Pkg.Revision set to 24.0.0.

Comments

0

I had this problem trying to build at the command line following react native's documentation. I resolved this problem by opening the project in android studio. The mismatched dependencies will appear in the build failure snackbar at the bottom of the App. For each failure, click on the link to resolve the issue.

Comments

0

I found out that it also happens if you uninstalled some packages from your react-native project and there is still packages in your build gradle dependencies in the bottom of page like:

{ project(':react-native-sound-player') } Make sure to remove the associated code in the MainApplication.java file after removing the project(':react-native-sound-player')

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.