How to change the version of the 'default gradle wrapper' in IntelliJ IDEA?
Solution 1
The easiest way is to execute the following command from the command line (see Upgrading the Gradle Wrapper in documentation):
./gradlew wrapper --gradle-version 5.5
Moreover, you can use --distribution-type
parameter with either bin
or all
value to choose a distribution type. Use all
distribution type to avoid a hint from IntelliJ IDEA or Android Studio that will offer you to download Gradle with sources:
./gradlew wrapper --gradle-version 5.5 --distribution-type all
Or you can create a custom wrapper
task
task wrapper(type: Wrapper) {
gradleVersion = '5.5'
}
and run ./gradlew wrapper
.
Solution 2
Open the file gradle/wrapper/gradle-wrapper.properties
in your project. Change the version in the distributionUrl
to use the version you want to use, e.g.,
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
Solution 3
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
Solution 4
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.
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
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
Solution 5
I was facing same issue for changing default gradle version from 5.0 to 4.7, Below are the steps to change default gradle version in intellij
1) Change gradle version in gradle/wrapper/gradle-wrapper.properties in this property distributionUrl
2) Hit refresh button in gradle projects menu so that it will start downloading new gradle zip version
Related videos on Youtube

Bloke
Updated on February 13, 2022Comments
-
Bloke 10 months
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(type: Wrapper) { gradleVersion = '1.10' }
in my
build.gradle
and rebuild, it is built with Gradle 1.9 again (so nothing actually happens).These seem to be all the settings: (and IntelliJ's help section about Gradle doesn't help at all :( )
-
The End over 8 yearshave tried this: stackoverflow.com/questions/24460299/… just delete the wrapper files and then execute the
wrapper
task again
-
-
dabluck almost 6 yearsbetter to use the gradle task they created for this purpose so the scripts update properly, etc.
-
dabluck over 5 yearsthey also update their binary files and scripts, which you do not get unless you run the update task. this could potentially create incompatibilties
-
Philippe about 5 yearsIf running the task in a root project that contains sub-projects, run
./gradlew :wrapper
with a colon in front of the task name. -
Ilya Serbis almost 5 yearsYep. See Upgrading the Gradle Wrapper in Gradle documentation.
-
Zhasulan Berdibekov 9 monthsIf u want install last version at 2022 y ./gradlew wrapper --gradle-version 7.4.1