Gradle is not using "git" binary from the correct path


(Rohan Dhruva) #1

I’m using gradle from with Android studio. I’m on OSX 10.10.5.

The project I’m trying to build uses “git” command in its build.gradle: https://github.com/nickbutcher/plaid/blob/master/app%2Fbuild.gradle#L29

While trying to build, I get this error:

Error:(29, 0) Cause: error=13, Permission denied
<a href="openFile:/Users/rdhruva/AndroidStudioProjects/plaid/app/build.gradle">Open File</a>

The permission denied is happening because /usr/bin/git is blocked by company policy (some security issues). We have a correct git binary in /opt/mycompany/bin/git. The path, /opt/mycompany/bin is the first line in /etc/paths. I believe that on OSX that’s the right way to provide the correct path, which gradle is ignoring for some reason. Running which git in a terminal also shows the right path.

My (uneducated) guess is that gradle is hard-coding the path to git somewhere internally.


(Rohan Dhruva) #2

To provide some more info, here’s the top-level build.gradle: https://github.com/nickbutcher/plaid/blob/master/build.gradle

Here’s the log from IDE: http://pastebin.com/qFFGKK49