ChatGPT解决这个技术问题 Extra ChatGPT

Failed to find Build Tools revision 23.0.1

I am trying to build my first app with react-native.

I am following these 2 tutorial:

https://facebook.github.io/react-native/docs/getting-started.html#content

https://facebook.github.io/react-native/docs/android-setup.html

I am sure that I installed all the requirements from the second link but when I try running my app with react-native run-android, I get the following error:

https://i.stack.imgur.com/RBAfL.jpg

I executed this command while running genymotion.

This is all that I have installed in Android SDK:

https://i.stack.imgur.com/TsXGk.jpg

https://i.stack.imgur.com/MPQEj.jpg

I tried to install Android build tools 23.0.1 but I get this error:

https://i.stack.imgur.com/07SY9.jpg

What should I do?


P
Pengguna

You should install Android SDK Build Tools 23.0.1 via Android SDK. Don't forget to check Show Packages Details.

https://i.stack.imgur.com/yzE44.png


I had to remove build build tools using SDK manager firstly and then add it again. It fixed the issue.
Hi, for future googlers: if the version you are looking for does not exist press the box Show Package Details
I had to install both the platform (details + Google API) and the tools.
G
Gustavo Soler

I faced the same problem and I solved it doing the following:

Go to /home/[USER]/Android/Sdk/tools and execute:

$android list sdk -a

Which will show a list like:

Android SDK Tools, revision 24.0.2 Android SDK Platform-tools, revision 23.0.2 Android SDK Platform-tools, revision 23.0.1

... and many more

Then, execute the command (attention! at your computer the third option may be different):

$android update sdk -a -u -t 3

It will install the 23.0.1 SDK Platform-tools components.

Try to build your project again.


worked for me - android studio is installed at ~/Library/Android/sdk/tools on mac
It installed revision 25.0.1 not 23.0.1
@LukasLiesis From the first command android list sdk -a check what number 23.0.1 gets. It will change over time. Yesterday it was 12. So the install command was android update sdk -a -u -t 12
@Manwe how can i get that number? P.s. already installed required version with sdk manager, but still, for future googlers :-)
Thanks, by the way ./android is deprecated, now in /home/[USER]/Android/Sdk/tools/bin you can run ./sdkmanager --list to get the same result After that I fixed it by finding a build-tools version that was matching a version found in sdk/extras/android/m2repository/com/android/support/appcompat-v7
R
Ronan Boiteau

Either install v23.0.1 of the build tools (the fifth row in your screenshot), or change your code to use the build tools version you already have installed (v23.0.3). This can be specified in your app's build.gradle file:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        ...
    }
}

As per duncanc4's comment below,

The build.gradle file you want to edit is in the android/app folder within your project directory.


i tried installing it but i get the error in the last image. How do i choose what build tool version to use?
He's using react-native, so i'm not sure how much access he's got to the build.gradle file.
Interesting, the build is still obviously using gradle under the hood (see the terminal snapshot) so I would expect it to be hiding in there somewhere...
With Android Studio 3.0.1 and Gradle 4.3.1 there is no buildToolsVersion property, so I added it into defaultConfig (in the same file) and it stopped showing the error.
As of v3.0.0 of the Android Gradle plugin, the build tools version is automatically determined based on the plugin version (but can be overridden, I believe).
R
Ronan Boiteau

The error you're getting seems to be related to system's permissions, since it's not able to create a folder.

Try running the sdk-manager using root (with su or sudo commands).


R
Ronan Boiteau

I had this error:

Failed to find Build Tools revision 23.0.2

When you got updated/installed:

Android SDK Build Tools Android SDK Tools

Change version number in build.gradle

FROM

buildToolsVersion "23.0.2"

TO

buildToolsVersion "25.0.2"

How to find what Build Tools version you have


x
xiongjiabin

Check your $ANDROID_HOME, sometimes is /usr/local/opt/android, but it's not your install sdk path, change it and fix this problem


Thankyou so much. I've been going in circles for hours between Failed to find Build Tools revision *.0.0 and install build tools *.0.0 and sync project. On Windows, I added ANDROID_HOME="C:\Users\Administrator\AppData\Local\Android\sdk" as a system variable. Finally works.
C
Community

Nothing helped until I found this solution : https://stackoverflow.com/a/39068538/3995091

In Android SDK, the build tools with the correct version where shown as installed, but still I got the same error saying they couldn't be found. When I used the above solution, I found out they were indeed not installed, although Android SDK thought they were. Installing them solved it for me.


b
bawa g

While running react-native In case you have installed 23.0.3 and it is asking for 23.0.1 simply in your application project directory. Open anroid/app/build.gradle and change buildToolsVersion "23.0.3"

https://i.stack.imgur.com/JDIBM.png


F
Futal

In the Gradle Console (link available in the window bottom right), you have two tabs: the error is shown in Gradle Build tab. Click on the Gradle Sync tab, then click on the Install Build Tools XX.X.X and sync project link. This will download the build version required by your project.

You may also change your project SDK version but you don't always have this option if it is imposed.


W
Waqleh

If you already install the correct Android SDK Platform-Tools (Build Tool) and you still get an error, try to invalidate the cache; File -> Invalidate caches / Restart....


n
noɥʇʎԀʎzɐɹƆ

On my system, Android SDK Manager showed /usr/local/Cellar/android-sdk as the SDK path, when $ANDROID_HOME was /Users/james/Library/Android/sdk. I just added a symlink for the correct build tools version.


j
jan4co

Two solutions: You have to instal the required buildToolVersion or set it as described above.
Notice that if you are trying to set the buildToolsVersion "23.0.3" using Android Studio 3.0 or more it won't work until you remove all builversion you have keeping just one last version you use. I read this somewhere else and this works for me. Hope this helps.


R
Ravi Teja Mureboina

As the error says Failed to find build Tools revision 23.0.1 This means that in your project you have used buildToolsVersion "23.0.3" So,You need to download the exact same version this makes the error disappear

**Step 1:**
GO to Tools and click SDK Manager
**Step 2:**
you can see SDK Platforms ,SDK Tools and SDK update Sites
**Step3:**
Click SDK Tools and click show package details
**Step 4:**
Select the version that you have mentioned in your Project 

These Steps has solved my issue.

t
theapache64

If anyone can't build their downloaded source code (probably google codelabs source code) with Android Studio, try simply remove the buildToolsVersion from the build.gradle file, and Android Studio will build the project with it's default latest buildToolVersion

¯_(ツ)_/¯


M
Mahozad

Each version of the Android Gradle Plugin now has a default version of the build tools.

So, probably you specified build tool version explicitly in the build file.
Just remove buildToolsVersion = "x.y.z" from your build.gradle script.

If, for some reason, you need that specific revision, follow the other answer.


n
naoufal zerai

https://i.stack.imgur.com/q9QZZ.png