How to update gradle in android studio

I installed Android Studio 0.1.9. Today I got and update to version 0.2 and of course I updated. After the installation I restarted Android Studio but now I get this message:

Project is using an old version of the Android Gradle plug-in. The minimum supported version is 0.5.0. Please update the version of the dependency 'com.android.tools.build:gradle'

How do I do that? I can't find any update tools for the gradle plugin in android studio.


Update gradle easily (Updated March 2018):

Step 1 (Use default gradle wrapper)

File→Settings→Build, Execution, Deployment→Build Tools→Gradle→Use default Gradle wrapper (recommended)

在这里输入图像描述

Step 2 (Select desired gradle version)

File→Project Structure→Project

在这里输入图像描述

The following table shows which version of Gradle is compatible with specific version of Android plugin for Gradle : 兼容性表

Latest versions you can use with Android Studio 3.1 (March 2018):

Plugin version: 3.1.0
Gradle version: 4.4

Official links

Version Compatibility

Migrate to Android Plugin for Gradle 3.0.0

Find out the latest version of Gradle

Info about the Gradle Wrapper


This may not be the exact answer for the OP, but is the answer to the Title of the question: How to Update Gradle in Android Studio (AS):

  • Get latest version supported by AS: http://www.gradle.org/downloads (Currently 1.9, 1.10 is NOT supported by AS yet)
  • Install: Unzip to anywhere like near where AS is installed: C:Users[username]gradle-1.9
  • Open AS: File->Settings->Gradle->Service directory path: (Change to folder you set above) ->Click ok. Status on bottom should indicate it's busy & error should be fixed. Might have to restart AS

  • after release of android studio v 3.0(stable), It will show popup, If gradle update is available

    OR

    Manually, just change version of gradle in top-level(project-level) build.gradle file to latest,

       buildscript {
          ...
          dependencies {
            classpath 'com.android.tools.build:gradle:3.0.0'
          }
        }
    

    check below chart

    The Android Gradle Plugin and Gradle
    
     Android Gradle Plugin            Requires Gradle
     1.0.0 - 1.1.3                    2.2.1 - 2.3
     1.2.0 - 1.3.1                    2.2.1 - 2.9
     1.5.0   2.2.1+                   2.2.1 - 2.13
     2.0.0 - 2.1.2                    2.10  - 2.13
     2.1.3 - 2.2.3                    2.14.1+
     2.3.0+                           3.3+
     3.0.0+                           4.1+    
    

    check gradle revisions

    链接地址: http://www.djcxy.com/p/77318.html

    上一篇: “Gradle版本2.10是必需的。” 错误

    下一篇: 如何更新android studio中的gradle