Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set gradle home while importing existing project in Android studio

People also ask

What is Gradle home location?

The Gradle plugin (which includes a packaged version of gradle) should already be installed at where/you/installed/android-studio/plugins/gradle, so you shouldn't need to download it manually. That last directory may be where/you/installed/android-studio/gradle/gradle-1.1.

How do I set the Gradle home path in Windows?

Set Gradle Path:Go to Advanced System Settings -> Click on Environment Variables -> then you could see the below window. Select the Path under the User variables section and click on the Edit button. Click on the New button. Fill the Gradle path until /bin and click on Ok and Close.


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.


For Mac OS, you can use the following -

  1. /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)
  2. /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.

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.


OSX (Less han two minutes)

  1. Open terminal
  2. Check if Gradle installed gradle --version, if so, goto step 4
  3. If not brew install gradle and Goto step 2
  4. Copy /usr/local/opt/gradle/libexec/
  5. Paste it in Import Project Window in Android Studio > Gradle Home
  6. Important, Celebrate!