Reputation: 12530
How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path.
Upvotes: 247
Views: 418412
Reputation: 481
You should be able to find it in
C:\Program Files\Android\Android Studio\Gradle\Gradle 2.2.1
(Replace the Gradle version with your actual version)
This is running Windows 7 64-Bit. Android Studio 1.0.2.
Upvotes: 48
Reputation: 6141
For my issue, I realised the java HOME
was not set on my M2 mac machine.
I set the java version via HomeBrew.
Then the gradle commands started to work fine
Upvotes: 0
Reputation: 1249
For OSX, if going to Finder, navigate to this category: /usr/local/opt/ if you do not see gradle folder, install your grandle version manually:
https://services.gradle.org/distributions/gradle-5.4.1-all.zip
https://services.gradle.org/distributions/gradle-4.4.1-all.zip
If you are looking for specific Gradle version, simply change the version number from the zip links above, unzip and add that in the Gradle folder /usr/local/opt/gradle
Upvotes: 0
Reputation: 684
For Ubuntu default version is /usr/lib/gradle/default
.
In case of update, you don't need to reassign link in idea/studio.
Upvotes: 0
Reputation: 30087
If you're using MacPorts gradle's home is:
/opt/local/share/java/gradle
Upvotes: 0
Reputation: 21
If you are on a Windows machine, go to the directory:
C:\Program Files\Android\Android Studio\gradle\
Click the gradle-4.4 folder from Android Studio\File\Settings, and then click the Apply button.
Upvotes: 2
Reputation: 2211
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
Upvotes: 3
Reputation: 4138
I've stumble across this question, trying to build an Ionic + Cordova app using Gradle from Android Studio installation, rather that installing Gradle separately.
On Centos, the Gradle binary was here: /home/YOURUSERNAME/.gradle/wrapper/dists/gradle-VERSION-all/CUSTOM_HASH/gradle-VERSION/bin
So, I've added export PATH=/home/maxim/.gradle/wrapper/dists/gradle-4.1-all/bzyivzo6n839fup2jbap0tjew/gradle-4.1/bin:$PATH
to my ~/.bashrc
and ionic cordova run android
command worked just fine.
Upvotes: 0
Reputation: 28529
For Mac,
/Applications/Android Studio.app/Contents/gradle/gradle-3.2
Upvotes: 8
Reputation: 601
OSX (Less han two minutes)
gradle --version
, if so, goto step 4brew install gradle
and Goto step 2/usr/local/opt/gradle/libexec/
Upvotes: 38
Reputation: 327
I used umake to install android studio. For me the path was
/home/user/.local/share/umake/android/android-studio/gradle/gradle-2.14.1
Upvotes: 1
Reputation: 173
In Windows
..\AndroidStudio2.0Beta6\android-studio\gradle\gradle-2.10
Upvotes: 0
Reputation: 379
On Linux run: whereis gradle
.
For me it was /usr/lib/gradle/1.10
.
Upvotes: 21
Reputation: 6641
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.Upvotes: 105
Reputation: 974
This is my solution on AndroidStudio/Idea for Mac
$ env | grep GRADLE
GRADLE_HOME=/usr/local/Cellar/gradle/2.6
GRADLE_USER_HOME=/Users/leon/.gradle
Upvotes: 1
Reputation: 1
Don't need to download or specify anything...
Just go to the install Android Studio plugins Path and search for any file like gradle-wrapper-x.xx.jar (x.xx = version number). Copy it to a subfolder of your project root folder named : gradle.
Example : - file found gradle-wrapper-1.12.jar in plugins folder of Android Studio Install's path - my project was on D:\android_repo\myProject - created a folder into D:\android_repo\myProject\gradle - copy gradle-wrapper-1.12.jar to this folder D:\android_repo\myProject\gradle - import again my project and no more question about gradle.
Upvotes: 0
Reputation: 340
On Arch Linux I could not find it, so I added:
echo $APP_HOME
to /usr/bin/grade (found over which gradle
)
The Install dir for me was /usr/share/java/gradle/
Upvotes: 4
Reputation: 4010
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.
Upvotes: 243
Reputation: 787
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.
Upvotes: 3
Reputation: 2383
I ran into same problem. I selected location C:\Program Files (x86)\Android\android-studio\plugins\gradle as Gradle Home
Upvotes: 13
Reputation: 1610
In Ubuntu 14.04 after $ sudo apt-get install gradle
I've got
$ whereis gradle
gradle: /usr/bin/gradle /usr/bin/X11/gradle /usr/share/gradle /usr/share/man/man1/gradle.1.gz
The path to Gradle was /usr/share/gradle
Upvotes: 11
Reputation: 12530
For migrating from eclipse to android studio
(Do not need to specify the Gradle home.)
Try this for windows users
http://blog.blundell-apps.com/setting-up-android-studio-gradle-windows-7/
Upvotes: 3
Reputation: 43
Download Gradle as described above, but make sure you download version 1.9 and not the current release (1.11). I just had the same problem and downloaded the current release only to have Android Studio tell me it wasn't supported.
Upvotes: 4
Reputation: 864
Upvotes: 26