How to create a Gradle build file to always use the latest available Android build tools

I have a Gradle build file that contains the following section:

android { compileSdkVersion 18 buildToolsVersion "18.0.0" 

This determines the exact version of the build tools used. Can this be indicated as a minimum requirement, as for dependencies?

I tried:

 android { compileSdkVersion 18 buildToolsVersion "18.0.+" 

Automatically use minor updates to build tools, if available, but this does not work. It raises the following error:

There was a problem evaluating the root project '####'.

Invalid full revision: 18.0. +

+4
source share
1 answer

This is a deliberate choice. The idea is that your assembly should be perfectly repeatable, and if you create another machine that may have a later version of the assembly tools, it will not start to suddenly generate errors. I could see an argument to substitute for the latest release of bugfix ala 18.0. + The way it does for other version lines in Gradle, but even then it breaks repeatability if there is regression in a newer version of the build tools.

The corresponding function request for this is https://code.google.com/p/android/issues/detail?id=59550

+2
source

Source: https://habr.com/ru/post/1499553/


All Articles