Gradle version and gradle -wrapper.properties

How to download the latest version of Gradle automatically as part of an Android project? Can I manually change the file gradle / wrapper / gradle -wrapper.properties

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

And change 2.4 to 2.6 and run gradlew? When I create an Android project, why is there no version from now on?

+5
source share
2 answers

How to download the latest version of Gradle automatically as part of an Android project? Can I manually change the file gradle / wrapper / gradle -wrapper.properties

Yes.
You should change gradle/wrapper/gradle-wrapper.properties

For instance:

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

Then sync the project. Android Studio will automatically download the new version.

And change from 2.4 to 2.6 and run gradlew?

First synchronize the project.

When I create an Android project, why is there no 2.6 from now on?

The new project is based on a template file.
For this reason, any new project currently has version 2.4.

You can change the template, but AS will update it with the following updates.

+6
source

You can change it manually, but I do not recommend it. Since the version of gradle wrapper is related to gradlew and gradlew.bat , they may need to change as well. If you want to update your gradle packaging, run it in Android Studio Terminal, if you are using Linux: ./gradlew wrapper --gradle-version 2.10 For Windows, change the command to gradlew wrapper --gradle-version 2.10

0
source

All Articles