75

I'm also trying to import the ABS in new updated Android Studio. I'm following this tutorial.

but on step Adding Action Bar Sherlock library to Android Studio im getting the error

Gradle Location is incorrect. here is pic.

enter image description here

When I go to the path C:\Users\Sir John Qadir\ there is no any gradle1.6 folder in there. How to resolve this?

4
  • install gradle and point it at that folder ... Commented Jul 12, 2013 at 21:09
  • where to install from it and is it not installed along with andorid studio intallation? Commented Jul 12, 2013 at 21:10
  • 1
    it will automatically get installed from internet while creating your first project. After that you can set the gradle as local path from gradle settings under File>Settings > Gradle. Commented Oct 4, 2013 at 13:08
  • How to set gradle home while importing existing project in Android studio Commented Jul 11, 2017 at 4:21

6 Answers 6

154

If you have installed your gradle with brew then it would be:

/usr/local/Cellar/gradle/<version>/libexec/ 
Sign up to request clarification or add additional context in comments.

2 Comments

This is the real answer! which path the IDE required? that's it!
This answer is the one that worked for me for IntelliJ! Lifesaver.
114

Try using this path:

For Windows

C:\Users\MyHome\.gradle\wrapper\dists\gradle-1.6-bin\<some random folder>\gradle-1.6 

For UNIX (Debian, Mac etc.)

~/.gradle/wrapper/dists/gradle-<a-version>-<bin or all>/<some random folder>/gradle-<a-version> 

5 Comments

~\.gradle\wrapper\dists\gradle-<a-version>-<bin or all>\<some random folder>\gradle-<a-version> for mac users
Im using /Users/vito/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1/ in my MacBook, thanks for solved my problem. ; )
What will be "some random folder" ?
Yeah, I don't know where that random folder is supposed to come from either.
This is not necessarily the solution for Mac (see answer below)
37

Point to the folder <gradle root folder>/libexec. Things should start working.

Comments

23

When using homebrew, instead of (as suggested in other answers):

/usr/local/Cellar/gradle/<version>/libexec/ 

It's better to use:

/usr/local/opt/gradle/libexec 

It's a symlink and will survive brew upgrade.

Comments

8

Create a build.gradle with:

task getHomeDir << { println gradle.gradleHomeDir } 

Then run it with:

gradle getHomeDir 

You should see something like:

/usr/local/Cellar/gradle/1.6/libexec 

You can use that to populate the Gradle plugin, and you’re off.

http://www.rabblemedia.net/blog/setting-up-gradle-plugin-for-intellij/

Comments

5

If you use brew to install gradle on mac, then use /usr/local/Cellar/gradle/4.0.1/libexec

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.