I'm using Android Studio 0.3.0 (configured to use gradle wrapper to build), Gradle 1.8. Everytime I build (or rebuild) the project with Android Studio, I get the error:
Gradle: A problem occurred evaluating project ':MyProject'.
> For input string: ""
Clicking on the error, here is the error code in build.gradle:
def getCommitsCount() {
return 'git rev-list --count HEAD'.execute().text.toInteger()
}
If I remove .toInteger()
then the error is gone. Otherwise, I can build the project from console just fine ./gradlew clean check build
.
Anyone is getting the same problem? It seems to be a problem of Android Studio. If you know any workaround or fix, that would be cool.
To find out what is the reason that output stream is empty access the error stream using err
.
def getCommitsCountError() {
return 'git rev-list --count HEAD'.execute().err.text.toInteger()
}
Is likely as JChord pointed that error can be.
"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun"
Then the solution is to (re)install Xcode Command Line Tools.
xcode-select --install
as git is connected to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With