Glide Process 'command 'git'' 以非零退出值 128 结束

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35029768/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:44:01  来源:igfitidea点击:

Glide Process 'command 'git'' finished with non-zero exit value 128

androidgitgradleandroid-glide

提问by michelletbs

I have downloaded Glide from Github and wanted to test the program on Android studio. But once i Clean the project, i have this error

我已经从 Github 下载了 Glide 并想在 Android Studio 上测试该程序。但是一旦我清理了项目,我就会遇到这个错误

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 

what does the error mean? I have build using Gradle.it is because of version problem on Android studio?

错误是什么意思?我使用 Gradle 进行构建。这是因为 Android Studio 上的版本问题吗?

回答by Zumbarlal Saindane

Same error occurred for me also.

我也发生了同样的错误。

In build.gradle previous code like

在 build.gradle 之前的代码中

exec {
        commandLine 'git', 'describe', '--tags'
    }

then I added 'cmd'before 'git'

然后我'cmd'之前加了'git'

and that error gone.

那个错误消失了。

below is code after adding the code

下面是添加代码后的代码

exec {
        commandLine 'cmd', 'git', 'describe', '--tags'

    }

回答by u6689352

exec {
    commandLine "git", "submodule", "update", "--init", "--recursive"
}

Then I added cmdbefore git.

然后我cmd之前加了git

and that error gone.

那个错误消失了。

exec {
    commandLine "cmd","git", "submodule", "update", "--init", "--recursive"
}

回答by Khan Hadiur

This happen if gitnot configured properly with the Android Studioproject.
And nobody seems experienced this before. Because I google thousand times and solutions not work.

如果项目git配置不正确,就会发生这种情况Android Studio
以前似乎没有人经历过这种情况。因为我用谷歌搜索了数千次,但解决方案不起作用。

What is just work for me:

什么对我来说只是工作:

  • Solution for Gradle Build Android Studio Project
  • Clone the project from git. Or Upload your project to gitand clone Freshin empty folder of your PC. (This is for configure gitproperly, other way did not work properly to my project)
  • Delete if any .ideafolder exists.
  • Open as existing Android Studioproject.
  • Let it roll. If it require any dependency, continue with that.
  • 解决方案 Gradle Build Android Studio Project
  • git. 或者将您的项目上传到您的 PC 的空文件夹中git并克隆Fresh。(这是为了git正确配置,其他方式对我的项目不起作用)
  • 如果.idea存在任何文件夹,请删除。
  • 作为现有Android Studio项目打开。
  • 让它滚动。如果它需要任何依赖,请继续。

回答by younes

new ByteArrayOutputStream().withStream { os ->
    def result = exec {
        executable = 'git'
        args = ['log', '-1', '--pretty=format:%ct']
        standardOutput = os
    }

    return os.toString() + "000"
}

Change to the following code

改为以下代码

new ByteArrayOutputStream().withStream { os ->
    def result = exec {
        executable = 'cmd'
        args = ['log', '-1', '--pretty=format:%ct']
        standardOutput = os
    }

    return os.toString() + "000"
}

回答by Greensouth

Take a look at this, it is the only answer that worked for me on OSX

看看这个,这是唯一在 OSX 上对我有用的答案

https://stackoverflow.com/a/27100821/2587350

https://stackoverflow.com/a/27100821/2587350