user2718067
user2718067

Reputation: 1603

How to check the gradle version in Android Studio?

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?

Upvotes: 130

Views: 240835

Answers (9)

Sherif Samir
Sherif Samir

Reputation: 685

Open your project on android studio.

Click on gear icon -> project structure -> Project

android-studio

Upvotes: 9

auspicious99
auspicious99

Reputation: 4311

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.

Upvotes: 1

Pratap
Pratap

Reputation: 19

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

Upvotes: 1

Knight Forked
Knight Forked

Reputation: 1619

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

Upvotes: 2

Yury Finchenko
Yury Finchenko

Reputation: 1065

  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.

Upvotes: 15

Jintin
Jintin

Reputation: 1478

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

Upvotes: 2

Adam Johns
Adam Johns

Reputation: 36343

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

enter image description here

Upvotes: 88

Scott Barta
Scott Barta

Reputation: 80010

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

Upvotes: 196

gezgingun
gezgingun

Reputation: 472

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)

Upvotes: 18

Related Questions