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

前端 未结 8 1158
忘掉有多难
忘掉有多难 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:27

    I just wanted to chime in that I hit this after updating Android Studio components.

    What worked for me was to open gradle-wrapper.properties and update the gradle version used. As of now for my projects the line reads:

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
    
    0 讨论(0)
  • 2020-12-23 16:34

    The 'wrapper' task in gradle is called if gradlew command is used, if you use gradle command to build the wrapper task is not called. So, there are two ways you can change your gradle version.

    1. Use 'gradlew build' command, this command will call the wrapper task that you mentioned. That task will change the 'distributionUrl' parameter in gradle-wrapper.properties file and it will automatically download the gradle version you want. Example distributionUrl in the file for version 4.2. distributionUrl=https://services.gradle.org/distributions/gradle-4.2-bin.zip

    2. If you are not using gradle wrapper simply download the version of the gradle you want and set environment variable path and also show it to IDEA.

    P.S. for more information about gradle wrapper I suggest you to read: https://docs.gradle.org/current/userguide/gradle_wrapper.html

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