relation between gradle version and gradle build tool version

自古美人都是妖i 提交于 2019-11-29 02:23:44

I will try to answer your questions.

  1. As you said, Gradle is a build tool, but the line you have mentioned in your first question is referring to Gradle Java plugin version. Gradle has plugin for building Java projects. These plugins extend upon the general purpose build tool Gradle is, and may provide additional features. You can read more about the Gradle plugins here.

  2. The reason your build fails when you change the plugin version is simple, the plugin version 0.8 is not there. There is a relationship between Gradle version and the plugin version and a developer has to maintain that. You can only use a plugin version which has been released and is compatible with the Gradle version. I hope the answer to first question answers this anyways.

Gabriele Mariotti

1) Gradle is a build tool, but it requires specific plugin to work. Android Tool Team is releasing the Android plugin for Gradle.

com.android.tools.build:gradle:0.6.+ 
com.android.tools.build:gradle:0.7.+ 
com.android.tools.build:gradle:0.8.+ 

Here you can find the repo: https://android.googlesource.com/platform/tools/base/

The current dev branch is idea133. Otherwise you can check gradle_0.8/gradle_0.7 branches.

2) There is a relation between gradle-plugin and the gradle version. For example

com.android.tools.build:gradle:0.6.+  -> gradle 1.8
com.android.tools.build:gradle:0.7.+  -> gradle 1.9
com.android.tools.build:gradle:0.8.+  -> gradle 1.9/1.10

You can find gradle version used in your project in the file gradle/wrapper/gradle-wrapper.properties

Also there is a relation between gradle-plugin and the IDE version. For example:

Android Studio 0.3.x -> gradle-plugin 0.6
Android Studio 0.4.x -> gradle-plugin 0.7
Android Studio 0.4.3+ -> gradle-plugin 0.8

For updated news you can check this link: http://tools.android.com/recent

You can also check this updated post:

Android Studio Gradle issue upgrading to version 0.5.0 - Gradle Migrating From 0.8 to 0.9 - Also Android Studio upgrade to 0.8.1

If you change your plugin version, check compatibility, and then click sync project with your gradle files.It will download a new plugin version if you need it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!