How to update gradle for Android

To update Android Plugin for Gradle:
You can find the list of available plugin versions in:
Android Studio\gradle\m2repository\com\android\tools\build\gradle\ directory. In my case I have:

  • 1.3.0
  • 1.5.0
  • 2.1.0-alpha3
  • 2.1.0-alpha4

Use the desired version by editing your project build.gradle file.
Example of build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:2.1.0-alpha4'
}

To update Gradle:
In your project directory navigate to \gradle\wrapper\ directory and edit:
gradle-wrapper.properties file.
Example: To change from version 2.8 to version 2.10
before: distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
after: distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
At the end in Android Studio select: ToolsAndroidSync Project with Gradle files

References
http://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio

How to install Gradle on Windows

  1. Unzip the Gradle download to the folder to which you would like to install Gradle, eg. “C:\Program Files”. The subdirectory gradle-x.x will be created from the archive, where x.x is the version.
  2. Add location of your Gradle “bin” folder to your path. Open the system properties (WinKey + Pause), select the “Advanced” tab, and the “Environment Variables” button, then add “C:\Program Files\gradle-x.x\bin” (or wherever you unzipped Gradle) to the end of your “Path” variable under System Properties. Be sure to omit any quotation marks around the path even if it contains spaces. Also make sure you separated from previous PATH entries with a semicolon “;”.
  3. In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.7.0_06 and that %JAVA_HOME%\bin is in your Path environment variable.
  4. Open a new command prompt (type cmd in Start menu) and run gradle –version to verify that it is correctly installed.

References
http://bryanlor.com/blog/gradle-tutorial-how-install-gradle-windows
https://www.javacodegeeks.com/2013/04/how-to-install-gradle-2.html