AndroidStudio的Gradle笔记

The Android build system uses the Android Plugin for Gradle to support
building Android applications with the Gradle build toolkit. The
plugin runs independent of Android Studio so the plugin and the Gradle
build system can be updated independently of Android Studio.

Gradle是独立存在与AndroidStudio的,可以自己更新

When you update Android Studio, you may receive a prompt to
automatically update the Android Plugin for Gradle to the latest
available version. You can choose to accept the update or manually
specify a version based on your project’s build requirements.

AndroidStudio更新的时候你会收到Gradle的自动更新通知,也可以手动更新或者不更新

You can specify the Android Plugin for Gradle version in either the
File > Project Structure > Project menu in Android Studio, or the
top-level build.gradle file. The plugin version applies to all modules
built in that Android Studio project. The following example sets the
Android Plugin for Gradle to version 2.0.0 from the build.gradle file:

可以自定AndroidPlugin for Gradle通过以下方式:
1.File > Project Structure > Project > AndridPluginVersion
2.Project的build.gradle里面com.android.tools.build:gradle:1.5.0
Gradle
1.File > Project Structure > Project > GradleVersion
2.修改gradle/wrapper/gradle-wrapper.properties里面的

...
distributionUrl = https\://services.gradle.org/distributions/gradle-2.10-all.zip
...

修订版
Android Plugin for Gradle, Revision 2.0.0
Dependencies:

Gradle 2.10 or higher.
Build Tools 21.1.1 or higher.

这个意思就是要用android plugin for gradle:2.0.0
必须要2.10以上的gradle版本(Gradle在AndroidStudio安装路径下)
和21.1.1以上的BuildToolsVersion(这个是在SDK路径下)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章