简体   繁体   English

Android Build Tools是否可以始终保持最新状态(而不是指定版本)

[英]Can Android Build Tools always be up to date (instead of specifying version)

Okay, lets say you had an app, that you built with build Tools Version 21. Now, version 24 is out. 好的,假设您有一个使用构建工具版本21构建的应用程序。现在,版本24已发布。 Your app runs fine. 您的应用运行良好。 But, there may be optimizations and changes to the build tools that your app does not have when it builds. 但是,可能会对应用程序在构建时没有的构建工具进行了优化和更改。

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
...

My question is, is there a way to directly set the buildToolsVersion to latest version. 我的问题是,有没有一种方法可以直接将buildToolsVersion设置为最新版本。

Should you even update the build tools over time. 您是否应该随着时间的推移更新构建工具。 Does it make any difference? 有什么区别吗?


Just, to be clear, I am not trying to elicit opinions. 只是,要明确一点,我不是要征求意见。 More what is the standard model when dealing with build tool updates. 在处理构建工具更新时,更多的是标准模型。 Should I wait till I need something from the new version or keep updating for optimizations 我应该等到我需要新版本的内容还是继续更新以进行优化

You should always keep your Build Tools component updated by downloading the latest version using the Android SDK Manager. 您应该始终通过使用Android SDK Manager下载最新版本来更新Build Tools组件。 By default, the Android SDK uses the most recent downloaded version of the Build Tools. 默认情况下,Android SDK使用构建工具的最新下载版本。 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. 如果您的项目依赖于旧版本的“构建工具”,则SDK Manager允许您下载和维护用于这些项目的单独版本的工具。

From: Android Build Tool 来自: Android构建工具

EDIT 编辑

I didn't test it, but there are scripts to do it. 我没有测试它,但是有脚本可以做到这一点。

It may help you: SDK and Build Tools Autodetect 它可能会帮助您: SDK和构建工具自动检测

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM