Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change build tools version in Android Studio 3.0.1?

Tags:

I just upgraded my Android studio from 2.3 to 3.0.1. But I get this error message(I have already installed API 27 ) and don't know how to fix it, because I couldn't find the the build tools version in new version of android studio!

Error:Failed to find Build Tools revision 26.0.2 <a href="install.build.tools">Install Build Tools 26.0.2 and sync project</a> 

The gradle files are changed, also the project structure has only one tab!

Edit: this is the content of `app/build.gradle:

apply plugin: 'com.android.application'  android {     compileSdkVersion 27     defaultConfig {         applicationId "com.m.finalocr"         minSdkVersion 21         targetSdkVersion 27         versionCode 1         versionName "1.0"         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"     }     buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     implementation fileTree(dir: 'libs', include: ['*.jar'])     implementation 'com.android.support:appcompat-v7:27.0.2'     implementation 'com.android.support.constraint:constraint-layout:1.0.2'     testImplementation 'junit:junit:4.12'     androidTestImplementation 'com.android.support.test:runner:1.0.1'     androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' } 

As you can see, there is no buildToolsVersion in it. So, why my android studio looks for this specific version(26) of that when I have the 27 version installed on my computer? Also, where can I see the buildToolsVersion "26.0.2" and change it tobuildToolsVersion "27.0.3" ` ?

like image 857
user3486308 Avatar asked Mar 06 '18 17:03

user3486308


People also ask

How do I change my build tool version?

The Build Tools version of your project is (by default) specified in a build. gradle file, most likely in the app sub directory. Open the file and change/specify the Build Tools version you want to use by adding/changing a buildToolsVersion property to the android section: android { buildToolsVersion "24.0.

What is build tool version?

compileSdkVersion is the API version of Android that you compile against. buildToolsVersion is the version of the compilers (aapt, dx, renderscript compiler, etc...) that you want to use. For each API level (starting with 18), there is a matching . 0.0 version.


1 Answers

Your project is looking for Build Tools version 26.0.2, but you haven't yet downloaded and installed it on your computer.

To download it, go to Tools > Android > SDK Manager, then click on the "SDK Tools" tab at the top of the new window. Then select the "Show Package Details" checkbox in the lower right-hand corner. Finally, scroll down to where you see 26.0.2, check the checkbox next to it, and click "OK" to begin the install process.

If you want to change the Build Tools version in your project, that is specified in project's build.gradle file (in the 'app' module). Open the file and either add or update the Build Tools version you want to use by adding/updating the following property in the 'android' section:

android {     buildToolsVersion "27.0.3"     ... } 
like image 176
shagberg Avatar answered Dec 08 '22 05:12

shagberg