Xcode 11 - "Couldn't communicate with a helper application." 尝试添加 Swift 包时

Xcode 11 - "Couldn't communicate with a helper application." when attempting to add Swift Package

我在尝试向我的项目添加新的 Swift 包时遇到问题。

在 Xcode 11.3.1 我收到“无法与辅助应用程序通信”。错误信息。

PS 与 Xcode 11.4 错误消息已更改为“与服务的通信已中断。”

崩溃报告

查看控制台应用程序后,我发现发生了 com.apple.dt.Xcode.sourcecontrol.Git 崩溃。我已经在此处上传了崩溃报告...

https://gist.github.com/OliverPearmain/0320f34d6381d1bb7900ff266fc8d703

我终于明白这是什么了。我的 ~/.gitconfig 文件中有一些 Xcode 显然不喜欢的东西。

我通过删除 ~/.gitconfig 然后重试(它成功了)解决了这个问题。然后我尝试一点一点地删除部分 ~/.gitconfig 内容。

最终我确定这是导致问题的部分。

[includeIf "gitdir:~/some/path/"]
    path = "~/some/path/.gitconfig_include"

此部分适用于其他上下文。不知道为什么会导致 Xcode 呕吐。

在我的例子中,问题是由 ~/.gitconfig 中的空电子邮件行引起的。

将“email =”更改为“email = example.email.com”有帮助。

我的 ~/.gitconfig 中有一个过时的条目,difftool 设置为我现在没有的应用程序。

删除条目,重新打开 Xcode,问题消失。