我已经从Github下载了Glide,并希望在Android工作室上测试该程序。但是一旦我清理了项目,我就有了这个错误
Information:Gradle tasks [clean]
fatal: Not a git repository (or any of the parent directories): .git
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred evaluating settings 'glide-master'.
> Process 'command 'git'' finished with non-zero exit value 128
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Information:BUILD FAILED
Information:Total time: 0.28 secs
Error:fatal: Not a git repository (or any of the parent directories): .git
FAILURE: Build failed with an exception.
* Where:
Settings file '/Users/MyComputer/Downloads/glide-master/settings.gradle' line: 1
* What went wrong:
A problem occurred evaluating settings 'glide-master'.
> Process 'command 'git'' finished with non-zero exit value 128
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Information:1 error
Information:0 warnings
Information:See complete output in console
错误是什么意思?我使用Gradle.it构建是因为Android studio上的版本问题?
答案 0 :(得分:2)
如果使用git
项目未正确配置Android Studio
,就会发生这种情况
以前似乎没有人经历过这个。因为我google千次,解决方案不起作用。
什么对我有用:
Gradle Build Android Studio Project
git
克隆项目。或者将项目上传到git
并将Fresh
克隆到PC的空文件夹中。 (这适用于配置git
,其他方式对我的项目无效).idea
文件夹。Android Studio
项目开放。答案 1 :(得分:2)
我也发生了同样的错误。
在build.gradle之前的代码中,如
exec {
commandLine 'git', 'describe', '--tags'
}
然后我在'cmd'
'git'
并且错误消失了。
下面是添加代码后的代码exec {
commandLine 'cmd', 'git', 'describe', '--tags'
}
答案 2 :(得分:2)
exec { commandLine“ git”,“子模块”,“更新”,“-init”,“-递归” } 然后我在'git'之前添加了'cmd'
那个错误消失了。
exec { commandLine“ cmd”,“ git”,“子模块”,“更新”,“-init”,“-recursive” }
答案 3 :(得分:0)
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'git'
args = ['log', '-1', '--pretty=format:%ct']
standardOutput = os
}
return os.toString() + "000"
}
更改为以下代码
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'cmd'
args = ['log', '-1', '--pretty=format:%ct']
standardOutput = os
}
return os.toString() + "000"
}
答案 4 :(得分:0)
看看这个,这是在OSX上对我有用的唯一答案