首先来一段从stackoverflow上看到的英文解释
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.
大致意思就是说compileSdkVersion 是你要进行编译时对应的android Api的版本号,而buildToolsVersion 是进行编译时编译器的版本号,并且编译器的版本号可以高于Api的版本号以获取更优化的编译后的文件,也就是说buildToolsVersion >compileSdkVersion 是可以的
同时从Api版本18开始,每个版本都对应有一个.0.0的buildToolsVersion 版本号,也就是compileSdkVersion 为18时,对应的buildToolsVersion 肯定有18.0.0
而且,在Eclipse和Ant中我们不指定buildToolsVersion版本时,IDE会帮我们自动选择最新的来带入,而Android Studio则要我们手动设置
最后想要详细了解compileSdkVersion, buildToolsVersion, minSdkVersion and targetSdkVersion的关系可以查看下面这个网站https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd#.2m2uy5ugy