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?
So yes, it is optional and defaults to latest.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With