How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path.
This worked. C:\Program Files\Android\Android Studio\gradle\gradle-3.2
I tried byteit101's solution but whether I chose android-studio-path/plugins/gradle
or android-studio-path/plugins/gradle/lib
the IDE said it isn't correct.
Then I changed the gradle home to android-studio-path/gradle/gradle-x.x.x
and it works.
Mac OSX / Linux
Step 1: Open terminal :)
Step 2: Open .bash_profile in vim to edit:
> vi ~/.bash_profile
Step 3: Add line:
> export GRADLE_HOME=/usr/local/opt/gradle
(for me it was this location, it can be different for u)
Step 4: Add line:
> export PATH="$PATH:$GRADLE_HOME/bin"
(to export bin directory of gradle)
Step 5: Verify by reopening the terminal or new tab, and check by echoing:
> echo $GRADLE_HOME
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.If you're using MacPorts gradle's home is:
/opt/local/share/java/gradle