Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
454 views
in Technique[技术] by (71.8m points)

android - How to solve failed to find build tools revision 26.0.2?

I'm trying to Install Build Tools 26.0.2 and sync project

Failed to find build tools revision 26.0.2

I clicked "Install Build Tools 26.0.2 and sync project" but still failed ... Downloaded it from the external link .. but I don't know where I put it. So, What should I do? and THANKS

image1 image2

question from:https://stackoverflow.com/questions/47721952/how-to-solve-failed-to-find-build-tools-revision-26-0-2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Android Studio is looking for build tools 26.0.2, but build tools 27.0.3 is already released for Android Oreo 8.1

I am not totally sure why, but Android Studio doesn't set the build tools in the gradle "app" file anymore. So here is how I fixed it. You get two options.

Method 1 - Install the missing build tools

1) Open the SDK manager by clicking on the icon in the top right of Android Studio. It looks like an android head in front of a download arrow. (Or go to File > Settings > Appearance & Behavior > System Settings > Android SDK)

2) Open SDK Tools tab

3) At the bottom-right, click "Show Package Details"

4) Find Android SDK Build-Tools and check the checkbox next to 26.0.2

5) Click apply in the bottom of the window

Method 2 - Use latest build tools

1) Follow instructions above

2) Uncheck all build tools besides 27.0.3 (the latest build tools at the time of writing)

Then you can define android build tools 27.0.3 in your gradle app file. To do this:

3) Make sure build tools 27.0.3 is installed by using the Android SDK manager (steps above).

4)Then find your build.gradle file. Use the navigation pane to the left of android studio. If it's closed click the icon that looks like the android studio icon to the far left of android studio (it should have text that is sideways, and normally says "1:project"). Then use the file tree to find the file [yourappname] > app > build.gradle

5) Open the file and it should have something along the lines of "apply plugin: 'com.android.application'" as the first line. Then add a new line under "compileSDKVersion" type in buildToolsVersion "27.0.3"

6) Then sync your project and you should be good to go!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...