118

When compiling this official project with Android Studio 0.82, it shows error note:

Error:The project is using an unsupported version of the Android Gradle plug-in (0.9.2)

After some searching, I decide to manually change content in the build.gradle file in line

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

to the gradle version that is installed in Android Studio.

The question is, can how to check the gradle version in my Android Studio?

Community
  • 1
  • 1
user2718067
  • 1,443
  • 3
  • 11
  • 14

9 Answers9

182

File->Project Structure->Project pane->"Android plugin version".

Make sure you don't confuse the Gradle version with the Android plugin version. The former is the build system itself, the latter is the plugin to the build system that knows how to build Android projects

Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
Scott Barta
  • 79,344
  • 24
  • 180
  • 163
87

Image shown below. I'm only typing this because of a 30 character minimum imposed by Stackoverflow.

enter image description here

Adam Johns
  • 35,397
  • 25
  • 123
  • 176
  • 2
    Good answer, nice that you pointed out that icon w/the 1 next to it was the "project structure" button. An image should be worth 1000 words towards the min word count ;) – Deemoe Mar 23 '16 at 18:15
  • 1
    This will give the info about the gradle that the app is using and not the one installed. – Satyam Dec 10 '18 at 08:59
17

I'm not sure if this is what you ask, but you can check gradle version of your project here in android studio:

(left pane must be in project view, not android for this path) app->gradle->wrapper->gradle-wrapper.properties

it has a line like this, indicating the gradle version:

distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip

There is also a table at the end of this page that shows gradle and gradle plug-in versions supported by each android studio version. (you can check your android studio by checking help->about as you may already know)

gezgingun
  • 462
  • 5
  • 11
15
  1. Create new project in Android studio;

  2. Press Ctrl+Shift+Alt+S

  3. Proceed to "Project" section

  4. You can see actual gradle version and android pluging version. Copy that to your project.

Yury Finchenko
  • 1,035
  • 13
  • 19
2

You can install andle for gradle version management.

It can help you sync to the latest version almost everything in gradle file.

Simple three step to update all project at once.

1. install:

    $ sudo pip install andle

2. set sdk:

    $ andle setsdk -p <sdk_path>

3. update depedency:

    $ andle update -p <project_path> [--dryrun] [--remote] [--gradle]

--dryrun: only print result in console

--remote: check version in jcenter and mavenCentral

--gradle: check gradle version

See https://github.com/Jintin/andle for more information

Jintin
  • 1,426
  • 13
  • 22
2

I know this is really old and most of the folks have already answered it right. Here are at least two ways you can find out the gradle version (not the gradle plugin version) by selecting one of the following on project tab on left:

  1. Android > Gradle Scripts > gradle-wrapper.properties (Gradle Version) > distributionURL
  2. Project > .gradle > x.y.z <--- this is your gradle version
Knight Forked
  • 1,529
  • 12
  • 14
2

Open your project on android studio.

Click on gear icon -> project structure -> Project

android-studio

Sherif Samir
  • 259
  • 3
  • 5
0

yes, under that file you will find some thing like this distributionUrl=https://services.gradle.org/distributions/gradle-7.5-bin.zip

so your version would be 7.5

Pratap
  • 9
  • 2
0

As indicated by Scott Barta's answer,

Make sure you don't confuse the Gradle version with the Android plugin version. The former is the build system itself, the latter is the plugin to the build system that knows how to build Android projects

His answer then shows how to find the Android Plugin Version (you may also see this called Android Gradle Plugin Version on some versions of Android Studio) from within Android Studio.

Adam Johns' answer, on the other hand, shows how to find the Gradle Version. In fact, from his screenshot, both can be seen in the same place in Android Studio and they in general are different values.

However, in some cases it is not so convenient to import the project into Android Studio, let it gradle sync and then navigate to that place to view the versions. For example, you downloaded a project from somewhere like github with last update a few years ago, and want to know the Android Gradle Plugin Version to decide which version of Android Studio to use to open the project in the first place. In that case, checking the versions from the command line may be faster.

Some other answers have already indicated where to find the Gradle Version (in gradle-wrapper.properties).

For the Android Gradle Plugin Version, you can open the project level build.gradle file and look in the part on dependencies, where you may see something like:

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

In this example, the Android Gradle Plugin Version is 3.5.3, found without needing to first import the project into Android Studio.

auspicious99
  • 3,902
  • 1
  • 44
  • 58