Failed to find Build Tools revision 23.0.1

2020-01-24 20:05发布

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

I am following these 2 tutorial:

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:

Error

I executed this command while running genymotion.

This is all that I have installed in Android SDK:

enter image description here

enter image description here

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

enter image description here

What should I do?

13条回答
ゆ 、 Hurt°
2楼-- · 2020-01-24 20:45

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).

查看更多
地球回转人心会变
3楼-- · 2020-01-24 20:48

Just install it from Android Studio ;) enter image description here

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2020-01-24 20:50

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"

enter image description here

查看更多
趁早两清
5楼-- · 2020-01-24 20:50

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.

查看更多
放荡不羁爱自由
6楼-- · 2020-01-24 20:51

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.

查看更多
够拽才男人
7楼-- · 2020-01-24 20:55

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.

查看更多
登录 后发表回答