Как узнать версию gradle в windows

Asked

Viewed
418 times

In the build.gradle files, sometimes (I’m not sure when) you’ll have to specify what version of gradle is used. The last few updates of Android Studio kept breaking some build files which listed the gradle version in use. I would have to update the gradle version number to fix the build file. I wanted to know if there’s a way to figure out what version of gradle is included with Android Studio, instead of having to guess. I haven’t been able to find out how to do this through Android Studio.

  • android
  • android-studio
  • android-gradle-plugin

asked Jul 9, 2014 at 17:42

aceperry's user avatar

aceperryaceperry

1872 silver badges7 bronze badges

1

2 Answers

On Windows you can navigate to C:\Users\<user>\.gradle\wrapper\dists and you can see which gradle versions have been downloaded

answered Jul 9, 2014 at 17:45

MrEngineer13's user avatar

MrEngineer13MrEngineer13

38.7k13 gold badges75 silver badges93 bronze badges

4

  • Thanks for that! I’m using Ubuntu so the directories are slightly different. For linux, it’s in ~/.gradle/wrapper/dists/ which is pretty much the same. Quick question, I’m guessing that 1.12 means 0.12 in the build files? Also, I have 5 directories, so I’m assuming that I can use all of them, with different gradle versions?

    Jul 10, 2014 at 10:12

  • You’re mixing up two things: gradle and gradle plugin. 1.12 is the version of gradle itself, whilst 0.12 is the version of gradle plugin. In build files you only specify gradle plugin version.

    Jul 10, 2014 at 11:09

  • Ok, thanks Damian. That clears up a lot since it’s not clear from the build files that they’re referring to the plugin, and not the actual gradle version.

    Jul 10, 2014 at 21:01

  • Which raises the question, how do you figure out what version of the gradle plugin do you have? I know someone earlier mentioned to read the release notes, but it’s not there (or is buried a few links deep) and the latest version didn’t have any release notes on the site. Really, there should be a more direct way to figure out this info from looking somewhere on your machine instead of relying on some release note which may or may not be outdated/exist.

    Jul 10, 2014 at 21:12

If you’re using gradle wrapper then you can change (or just check) gradle version number in gradle-wrapper.properties file. In order to do this you have to modify distributionUrl

answered Jul 9, 2014 at 17:49

Damian Jeżewski's user avatar

Damian JeżewskiDamian Jeżewski

1,2462 gold badges14 silver badges21 bronze badges

4

  • I have no idea what gradle wrapper is. How can you tell if you’re using gradle wrapper? I’m just using the standard Android Studio IDE, that I downloaded from Google, and updated using the update mechanism. Does that setup use gradle wrapper? I don’t really touch gradle, and I suspect many others are in the same boat that I’m in.

    Jul 10, 2014 at 10:05

  • When you create/import project you have to decide if you would like to use standalone gradle installation or gradle wrapper. When you choose first option you have to specify gradle path and manually manage gradle version. In the second case you can use graddle wrapper which is responsible for downloading gradle version specified in gradle-wrapper.properties config. It’s very convienient when e.g. when you’re building your project on CI server and you want to be sure that specific gradle version is used.

    Jul 10, 2014 at 11:13

  • I just created a new app in Android Studio and it never gave me a choice between standalone or gradle wrapper. In fact, the wizard didn’t have anything to do with gradle, except at the end after creating the project, when it put up a notice about gradle finishing. I hope you understand that the way gradle is handled by Android Studio can be very confusing.

    Jul 10, 2014 at 21:16

  • I must have mixed something up. If I remember correctly there is such choice when you import existing project. In case you’re creating new project I suppose the default is to use gradle wrapper.

    Jul 10, 2014 at 21:41

  • The Overflow Blog
  • Featured on Meta

Related

Hot Network Questions

  • Why is a stray semicolon no longer detected by `-pedantic` modern compilers?

  • First direct conflict within Israel’s boundaries since the 1948 Arab–Israeli War?

  • 以后我少的一点儿 what does this mean?

  • How to safely pause Garmin navigations?

  • How can unrelated language families exist?

  • General Term for the Sequence 0, 1, 5, 6, 13, 14, 18, 19, 29, 30, 34, 35, 42

  • What happened to my car

  • Why did Doctor Strange believe the Fantastic Four were related to popular music in the 1960s?

  • Bugs getting into screen deck through metal roofing gaps

  • How to stop Steam trying to read from a non-existent drive?

  • Sum the inverse of the successor of the square of the natural numbers

  • Open pdf from a commadn line and go back to the command line

  • Why did Vincent risk his chance of going to space by giving his true urine sample to Dr. Lamar in the last scene?

  • How to take good photos of stars out of a cockpit window using the Samsung 21 ultra?

  • Proof the quaternions are 4-dimensional?

  • Understanding TLS Protections Against DNS Spoofing and Fake Websites

  • What could happen if my university loses its R2 status?

  • Is every character of the algebra of continuous functions on a locally compact space some evaluation?

  • What is Hamas’ strategy in attacking Israel?

  • How to know the sample arithmetic mean and standard deviation if I know the mean and the deviation of the logarithm of the observations

  • Why is the central truss segment of the ISS called S0?

  • Spacing on text macros

  • Bad experiences at conferences, worth going anyway?

  • Why are these SATA bus ports different?

more hot questions

Question feed

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Learn how to search the current version of Gradle used in your Android project.

Gradle by itself is a general purpose build tool. It can be used to build almost anything you care to implement in the build script. It is declarative, since you don’t want to see lots of code in the build file, which is not readable and less maintainable. One common question of every new developer of Android is how to know the current version of Gradle in the working project.

In this short article, we will explain you briefly how to know which version of graddle is using your Android Project.

A. From Android Studio

You can directly check the version of gradle used by your android project in Android Studio from the project structure. Go to File > Project structure:

Android Studio Project Structure

In the new window that will appear, go to the Project tab and verify the version of gradle in the Gradle version field:

Gradle Version Project Structure Android Studio

B. From the gradle-wrapper.properties file

You can see as well the gradle version in the \YourProject\gradle\gradle-wrapper.properties file of your project without opening Android Studio. The file contains the following content:

#Mon Apr 08 17:22:20 COT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

Or do it as well from Android Studio:

Gradle Wrapper Properties File

So easy it is to know the version of gradle !

Happy coding !

There are multiple ways in which you can find out the version of the Gradle tool that you are using in Android Studio for your Android Project. Let us take a look at a few of them.

  1. You can simply open your Android Studio IDE and go to Menu: File -> Project Structure… and take a look at the «Android Gradle Plugin Version».

    Project Structure - Android Studio

    How to determine Gradle Version in Android Studio

  2. Open the Terminal in Android Studio by going to Menu: View -> Tool Windows -> Terminal. Run the command.


    Windows:

    gradle --version

    Linux/macOS:

    ./gradlew --version

    Note: This is what you will check only if you are using Gradle installed on your device and not the gradlew.

  3. In your project, look for the gradle-wrapper.properties here you should be able to see the version for property distributionUrl

    #Mon May 22 17:30:33 CDT 2023
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    
  4. When you perform Gradle Sync, in the console you can note the version of Gradle.
    ...
    Starting Gradle Daemon...
    Gradle settings evaluated using settings file 'C:\Users\code2care\AndroidStudioProjects\MyApp\settings.gradle'.
    Gradle version: 8.0.0
    ...
    

Facing issues? Have Questions? Post them here! I am happy to answer!

  • Как узнать версию windows с помощью командной строки
  • Как узнать версию windows 10 через cmd
  • Как узнать версию explorer на windows 10
  • Как узнать виртуальную память компьютера windows 10
  • Как узнать версию сборки windows 11