Open joxad opened 7 years ago
my gradle
apply from: 'https://raw.githubusercontent.com/passsy/gradle-GitVersioner/master/git-versioner.gradle'
def version= "${major}.${minor}.${patch}"
def code = gitVersion.version
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion
dataBinding {
enabled = true
}
defaultConfig {
applicationId "xxx"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode code
versionName version
}
}`
This can happen if there is no .git
folder. check if you can run git status
manually. If you are executing on macOS, make sure you have started Xcode after you installed the last update.
Hi,
I am also facing the same issue, with the error:
-> Not a git repository (or any of the parent directories): .git ERROR: can't generate a git version, this is not a git project
and the lines:
// check if git project
def status = 'git status'.execute([], rootDir)
status.waitFor()
def isGitProject = status.exitValue()
is always returning 128.
The thing is, this script was working perfectly before, but recently, it is starting not working, not sure what is wrong...
I am using macOS, and has Android Studio 3.0
Thanks.
If you recently upgraded macOS you have to start Xcode and install the required components. Do you have brew installed? What's the output of brew doctor
? Brew would runs into the same problems.
Also consider upgrading to https://github.com/passsy/gradle-GitVersioner
Thanks, @passsy , It works now :)
I think somehow the git on my mac is not linked with Brew, I tried it now, and it is working perfectly.
Hello,
I have this error but I don't understand because I am in a git project : If I use git status it's working correctly : I guess this is a problem between git/gradle ?