Android gradle: buildtoolsVersion vs compileSdkVersion

前端 未结 2 1423
慢半拍i
慢半拍i 2020-11-28 02:59

What\'s the difference between buildtoolsVersion vs compileSdkVersion in the build.gradle for an Android project?

EDIT: Specifically, I\'d

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 03:50

    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.

    At IO 2014, we release API 20 and build-tools 20.0.0 to go with it.

    Between Android releases we will release updates of the compilers, and so we'll release version .0.1, .0.2, etc... Because we don't want to silently update these version under you, it's up to you to move to the new version when it's convenient for you.

    You can use a higher version of the build-tools than your compileSdkVersion, in order to pick up new/better compiler while not changing what you build your app against.

提交回复
热议问题