Gradle version 1.10 is required. Current version is 2.0

后端 未结 8 963
傲寒
傲寒 2020-12-02 08:50

I am trying to use latest Gradle version (2.0), however I keep getting this message when hitting gradle build in terminal. Why is it asking for 1.10 version

相关标签:
8条回答
  • 2020-12-02 09:00

    Looks like the current version of Android Gradle plugin (0.12.2) works with Gradle of version not later than 1.12.

    I haven't found a direct statement for that on the Tools site, there is this phrase only:

    Gradle 1.10 or 1.11 or 1.12 with the plugin 0.11.1.

    But I manually tested with Gradle 2.0 and 1.2 and it does not work, so I believe this restriction from the Tools site still applies for Android Gradle plugin 0.12.2.

    I would suggest to fail back to Gradle 1.12 by setting distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip in your gradle-wrapper.properties file.

    Then just use gradlew as usual.

    0 讨论(0)
  • 2020-12-02 09:01

    I fix the problem updating the gradle version within build.gradle file:

    dependencies {
    classpath 'com.android.tools.build:gradle:0.12.2'
    

    }

    This solve my problem. I hope this would help.

    0 讨论(0)
  • 2020-12-02 09:03

    IF ABOVE FIX DO NOT WORK TRY THIS

    You have to change this line in build.gradle

    classpath 'com.android.tools.build:gradle:0.9.+'
    

    in

    classpath 'com.android.tools.build:gradle:1.1.+'
    

    you have to change this line in your build.gradle

    buildTypes {
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    

    In

    buildTypes {
            release {
                 minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    
    0 讨论(0)
  • 2020-12-02 09:09

    If you are getting this problem because you moved project developed using old Android studio to new Android Studio, then just create new project in new Android Studio and cross check your gradle related files with newly create project.

    0 讨论(0)
  • 2020-12-02 09:10

    I was following wono's method on mac and I was getting "gradlew command not found" error. Fixed issue by changing mod of gradlew file

    chmod +x gradlew

    I hope this will help others

    0 讨论(0)
  • 2020-12-02 09:12

    The Android plugin requires a particular version of Gradle. The latest Android plugin version requires 1.12, the Android plugin version declared in your build requires 1.10.

    0 讨论(0)
提交回复
热议问题