Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is buildToolsVersion optional? [duplicate]

After updating to Android studio 3.0 and creating a new project I noticed that buildToolsVersion is missing and the project works fine.

so it's clearly optional now. my question is:
was it always this way or this is a new change?

how the version is chosen if I didn't specify one.
my first thought that it's automatically set to the newest version installed in SDK manager, but I found it set to build_tools_version: \"26.1.0\" in android-studio\build\android-profile\profile-2017-10-30-16-28-12-121.json
in spite of having build_tools version: 27.0.0 installed in my SDK manager.
it only changed to 27.0.0 after I manually added buildToolsVersion '27.0.0' to build.gradle

what is the best practice regarding adding buildToolsVersion to build.gradle since it's now in the default template in AS 3.0 and 3.1?

like image 845
humazed Avatar asked Oct 30 '17 14:10

humazed


People also ask

Is buildToolsVersion needed?

So yes, it is optional and defaults to latest.

What is the use of buildToolsVersion?

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.

How do I change my buildToolsVersion?

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.


1 Answers

If you check the SDK Build Tools Release Notes, it says:

By default, the Android SDK uses the most recent downloaded version of the Build Tools. If your projects depend on older versions of the Build Tools, the SDK Manager allows you to download and maintain separate versions of the tools for use with those projects

So yes, it is optional and defaults to latest.

like image 94
Nick Shvelidze Avatar answered Nov 13 '22 04:11

Nick Shvelidze