How to change the version of the 'default gradle wrapper' in IntelliJ IDEA?

前端 未结 8 1161
忘掉有多难
忘掉有多难 2020-12-23 15:42

I want to use Gradle 1.10 instead of 1.9. I cannot seem to find where to change this.

If I put this:

task wrapper(t         


        
8条回答
  •  春和景丽
    2020-12-23 16:08

    First, let gradle set the correct distribution Url

    cd projectDirectory
    ./gradlew wrapper --gradle-version 2.3.0
    

    Then - might not be needed but that's what I did - edit the project's build.gradle to match the version

        dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
    
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    

    Finally, delete the folders .gradle and gradle and the files gradlew and gradlew.bat. (Original Answer)

    Now, rebuild the project.

    As the other answers did not suffice for me and the comment pointing out these additional steps is easy to overlook, here as a separate answer

提交回复
热议问题