How to set gradle home while importing existing project in Android studio
Solution 1
The gradle plugin (which contains a bundled version of gradle) should be already installed in where/you/installed/android-studio/plugins/gradle so you shouldn't need to manually download it. Depending on the version of Android Studio, that last directory may be where/you/installed/android-studio/gradle/gradle-x.y.z (x.y.z is the version, so check your filesystem for the exact path).
If you intend on doing gradle development outside Android Studio or want a different version, you can download it separately and point it at that path, but if you only want to get Android Studio working with the bundled version, this path should do it.
Solution 2
For Mac OS, you can use the following -
/usr/local/opt/gradle/libexec/
or more generically -path/to/gradle/libexec/
- this is recommended. (the first path is what's achieved after installing gradle via Homebrew)/path/to/android/studio/plugins/gradle
- I don't recommend this because this version of Gradle might be out of date, and Android Studio itself might say it's incompatible.
Solution 3
You should be able to find it in C:\Program Files\Android\Android Studio\Gradle\Gradle 2.2.1
. This is running Windows 7 64-Bit. Android Studio 1.0.2.
Solution 4
OSX (Less han two minutes)
- Open terminal
- Check if Gradle installed
gradle --version
, if so, goto step 4 - If not
brew install gradle
and Goto step 2 - Copy
/usr/local/opt/gradle/libexec/
- Paste it in Import Project Window in Android Studio > Gradle Home
- Important, Celebrate!
Solution 5
- Download Gradle http://www.gradle.org/downloads
- Install
- Set Gradle home to the install directory
Related videos on Youtube
Dennis MP
I love coding. Blog : http://1belong2jesus.wordpress.com/
Updated on July 08, 2022Comments
-
Dennis MP almost 2 years
How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path.
-
vharron about 10 yearsThe path plugins/gradle is to the gradle plugin, not gradle.
-
vharron about 10 yearsThe path plugins/gradle is to the gradle plugin, not gradle.
-
byteit101 about 10 yearsIs there any differences between them for the purposes of importing projects in Android Studio?
-
vharron about 10 yearsGradle plugin 0.9.0 and 0.10.0 both support Android Studio tools.android.com/tech-docs/new-build-system
-
AlexChaffee almost 10 yearsI think it'd be better to use a real gradle dir. It's wherever you installed it plus "libexec" for me, e.g.
/usr/local/opt/gradle/
(from Homebrew on Mac) -
Tyrel over 9 yearsI just tried this with Android Studio 0.8.0 and it complained about using the plugin directory. I noticed though that gradle seems to be entirely located within the lib subdir, so I then instead pointed Android Studio to where/you/installed/android-studio/plugins/gradle/lib and it worked.
-
Calin over 9 yearsA better option will be to use /usr/lib/gradle/default no to depend on specific version
-
Tim Boland over 9 yearson a mac, this didnt work for me...wouldnt allow me to select the build.gradle file for my project
-
hotzen over 9 yearsDo not point it to the gradle-plugin but to the gradle-library which is in
.../android-studio/plugins/gradle/**lib**
-
lagos over 9 yearsIf you point to the gradle-lib as last person commented you will get an error from Android Studio that is not the right folder.
-
OKGimmeMoney over 9 yearsthe directory in this answer was different for me. I used /install/path/to/android-studio/gradle/gradle-2.2.1
-
akauppi about 9 years@AlexChaffee Could you share the whole path entry you have there. I'm also on OS X + Homebrew. What do you mean by 'plus "libexec"', precisely? IntelliJ IDEA 14.0.3, gradle 2.3
-
akauppi about 9 yearsThanks, /usr/local/Cellar/gradle/2.3/libexec/ worked for me. + you might add that your reply has to do with OS X + Homebrew.
-
akauppi about 9 yearsOS X + Homebrew: /usr/local/Cellar/gradle/2.3/libexec/
-
Morteza Soleimani about 9 yearsThanks , It helped me :)
-
mnzl almost 9 yearsLine 68 in the /usr/bin/grade file
-
Friedrich Große over 8 yearsAlso works on fedora 22 if gradle has been installed using dnf
-
htafoya over 7 yearshow to know the install directory?
-
stackdave almost 7 yearssay me: "graddle libexe is not supported, would you like to use graddle wrapper to update automatically ?" i clicked "yes" and alles was ok, it was strange because ; "brew info gradle " give this folder "/usr/local/Cellar/gradle/3.1" but Android Studio does not recognise gradle there
-
David over 6 yearsExcellent. The key info for me here was that you need to point it to [...]/libexec
-
jim over 6 yearsMine was here: C:\Program Files\Android\Android Studio\gradle\gradle-3.2
-
Kingsley Ijike over 6 yearsThanks! Just what I needed
-
The incredible Jan almost 5 years@htafoya how to know which operating system and installation type you use? "Installing manually" should be the easiest on all systems. The "install" directory is the directory where you extract to.
-
user3118604 almost 5 years@htafoya you can follow the official per-OS Gradle instructions found here gradle.org/install/#manually
-
Carnal over 4 yearsThat's how you do it!