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.