Xcode 在没有指定和错误的情况下失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10754784/
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-15 00:24:40  来源:igfitidea点击:

Xcode fails without specifying and errors

xcodebuildprojectworkspace

提问by Locksleyu

All of a sudden my project fails to build in Xcode. If I look at the log I see all the needed dependencies being built, and then I get a strange error:

突然间,我的项目无法在 Xcode 中构建。如果我查看日志,我会看到正在构建所有需要的依赖项,然后我收到一个奇怪的错误:

Verify final result code for the complete build operation
Build operation failed without specifying any errors. 
Individual build tasks may have failed for unknown reasons.

I removed my code directory and replaced it with a backup, did a clean, tried building all the other components separately (they succeed) - nothing works. I tried a command line build, same issue.

我删除了我的代码目录并用备份替换它,做了一个干净的,尝试单独构建所有其他组件(它们成功了) - 没有任何效果。我尝试了命令行构建,同样的问题。

There were only a few hits on google for this error, none offered any useful advice.

这个错误在谷歌上只有少数点击,没有人提供任何有用的建议。

Can anyone please help?

有人可以帮忙吗?

Update: When I run the command line build, I see the following error:

更新:当我运行命令行构建时,我看到以下错误:

2012-05-25 08:55:53.830 xcodebuild[3358:4203] No recorder, buildTask: <Xcode3BuildTask: 0x400f35e60:'ProcessPCH MyProject-Prefix.pch':REfc(32370056113422336):deps=0:phaseNum=4>

I checked the output of xcodebuild and it is returning '65'.

我检查了 xcodebuild 的输出,它返回“65”。

I thought there might be a problem with the MyProject-Previx.pch file, so I shut off "Precompile Prefix Header", and now I get the same error with a different file:

我认为 MyProject-Previx.pch 文件可能有问题,所以我关闭了“Precompile Prefix Header”,现在我在另一个文件中遇到了同样的错误:

2012-05-25 09:15:11.784 xcodebuild[3882:3703] No recorder, buildTask: <Xcode3BuildTask: 0x40048ab60:'CompileC HelperRoutines.m':REfc(33777199068741632):deps=0:phaseNum=4>

采纳答案by TheGhost

I also encountered same error. I was edited .pch (Prefix Header) file. Then I started getting this strange error. Then I removed all editions which I made in .PCH. Then I quit my Xcode. When I restarted Xcode this strange error was gone.

我也遇到了同样的错误。我被编辑了 .pch(前缀头)文件。然后我开始收到这个奇怪的错误。然后我删除了我在 .PCH 中制作的所有版本。然后我退出了我的 Xcode。当我重新启动 Xcode 时,这个奇怪的错误消失了。

Hope this will work for you also. Best luck Buddy (y)

希望这也适用于您。祝你好运 伙计 (y)

回答by maninvan

Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons. One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem. Some individual build task failures (up to 12) may be listed below.

构建操作失败,但未指定任何错误。个别构建任务可能因未知原因而失败。一个可能的原因是如果有太多(可能是僵尸)进程;在这种情况下,重新启动可能会解决问题。下面可能会列出一些单独的构建任务失败(最多 12 个)。

I've run into this problem consistently recently while running Xcode 9.0 Beta 3 and Xcode 8.3.3.

我最近在运行 Xcode 9.0 Beta 3 和 Xcode 8.3.3 时一直遇到这个问题。

The fix is to delete ALLin the Derived Data folder. It then seems to work again.

修复方法是删除派生数据文件夹中的ALL。然后它似乎再次工作。

rm -rf ~/Library/Developer/Xcode/DerivedData

NOTE: just cleaning the build or deleting the current build folder for a project does not seem to help.

注意:只是清理构建或删除项目的当前构建文件夹似乎没有帮助。

Hope this helps :)

希望这可以帮助 :)

回答by Mike

I was hitting this error and it infuriated me for an hour or so. The answer below helped me out a lot: essentially your machine has a ton of running processes, XCode can't handle it, and rebooting your machine is the best answer.

我遇到了这个错误,它激怒了我一个小时左右。下面的答案对我帮助很大:本质上你的机器有大量正在运行的进程,XCode 无法处理它,重启你的机器是最好的答案。

https://stackoverflow.com/a/13183522/1863655

https://stackoverflow.com/a/13183522/1863655

回答by Jose Ramirez

I looked around for a bit and the only one that worked for me was shortening my project folder name.

我环顾四周,唯一对我有用的方法是缩短我的项目文件夹名称。

All other tries: restarting, recloning, deleting derived data, etc. didn't work. The only thing that worked was making the project folder name shorter.

所有其他尝试:重新启动、重新克隆、删除派生数据等都不起作用。唯一有效的是使项目文件夹名称更短。

回答by Jerry Krinock

Happy 2019, everyone, but sad to say this can still happen in Xcode 10.2.

祝大家 2019 年快乐,但遗憾的是,这仍然会在 Xcode 10.2 中发生。

I had four projects open in Xcode but only one failed in this way. I tried a main menu > Product> Clean Build Folder. The little progress spinner started up and 5 minutes later was still spinning. Hmmmm.

我在 Xcode 中打开了四个项目,但只有一个以这种方式失败。我尝试了一个主菜单 > Product> Clean Build Folder。小进度微调器启动,5 分钟后仍在旋转。嗯嗯。

So I quit Xcode and in Terminal did a cd ~/Library/Developer/Xcode/DerivedData. Although ls -alwwshowed only one subfolder named after each of my other projects, as expected, there were five subfolders whose name began with the name of the problem project. I deleted all of them

所以我退出了 Xcode 并在终端中做了一个cd ~/Library/Developer/Xcode/DerivedData. 虽然ls -alww只显示了一个以我的每个其他项目命名的子文件夹,但正如预期的那样,有五个子文件夹的名称以问题项目的名称开头。我都删除了

rm -R ProblemProjectName-*

rm -R ProblemProjectName-*

and relaunched Xcode. Problem solved.

并重新启动了 Xcode。问题解决了。

回答by BLICK

Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.

This happens occur when the total path length is too long.

当总路径长度太长时会发生这种情况。

change the folder nameor location of directory, shorter then before.

更改文件夹名称或目录位置,比之前更短。

回答by Marcos Reboucas

Same issue when added watchOS target inside iOS app, using Xcode 11.1 with SwiftUI:

在 iOS 应用程序中添加 watchOS 目标时出现同样的问题,使用 Xcode 11.1 和 SwiftUI:

  • Go to menu Xcode / Preferences / Locations
  • Open Derived Datafolder in Finder clicking on the arrow next to /Users/yourUserName/Library/Developer/Xcode/DerivedData
  • Locate your app Derived Data folder and delete it
  • Menu Product / Clean Build Folder
  • 转到菜单Xcode / Preferences / Locations
  • 单击/Users/yourUserName/Library/Developer/Xcode/DerivedData旁边的箭头,在 Finder 中打开派生数据文件夹
  • 找到您的应用派生数据文件夹并将其删除
  • 菜单产品/清理构建文件夹

You should be able to compile again.

您应该能够再次编译。

回答by Shresth Pratap Singh

I know this is super late to answer but I'm answering since none of the above solutions worked. For me restarting, clean building, deleting derived data nothing worked. Because the issue was not due to any zombie objects or something like that. I'm using Xcode 11. I think it's an Xcode bug that sometimes errors are not shown in the issue navigator. But don't worry check the build report in Report navigator(The last tab in project navigator: the one that looks like a comment box with lines in it. or simply cmd + 9).

我知道这回答太晚了,但我正在回答,因为上述解决方案都不起作用。对我来说,重新启动、清理构建、删除派生数据没有任何效果。因为问题不是由任何僵尸物体或类似的东西引起的。我正在使用 Xcode 11。我认为这是一个 Xcode 错误,有时错误未显示在问题导航器中。但是不要担心检查报告导航器中的构建报告(项目导航器中的最后一个选项卡:看起来像带有行的注释框的那个。或者只是cmd + 9)。

Report navigator

报告导航器

Click the relevant build and resolve the issue, mine was missing file in pods directory. build logs

单击相关构建并解决问题,我的 pods 目录中缺少文件。 构建日志

回答by Miras Maratuly

just try to rename the folder name of the project. it did the trick for me

只需尝试重命名项目的文件夹名称即可。它对我有用

回答by danywarner

I had this same problem, however the accepted solution did not work for me, what worked was:

我遇到了同样的问题,但是接受的解决方案对我不起作用,有效的是:

  • deleting .workspacefile
  • deleting Podfile.lockfile
  • deleting the Podsfolder
  • pod deintegrate ; pod install
  • 删除.workspace文件
  • 删除Podfile.lock文件
  • 删除Pods文件夹
  • pod deintegrate ; pod install