Xcode:构建失败,但没有错误消息

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

Xcode: Build Failed, but no error messages

xcodebuild

提问by Jason

Using Xcode 4.5.1. Our project has been building fine for the last three months, but suddenly, when I try to build, it says "Build failed", but does not show any errors on the triangle exclamation mark tab, nor does it give a reason when it pops up build failed.

使用 Xcode 4.5.1。我们的项目在过去三个月中一直构建良好,但是突然,当我尝试构建时,它显示“构建失败”,但三角形感叹号选项卡上没有显示任何错误,弹出时也没有给出原因向上构建失败。

We have not changed the bundle identifier, or any other project properties. I tried a clean, then build, but no luck.

我们没有更改包标识符或任何其他项目属性。我尝试了清理,然后构建,但没有运气。

What may be causing the problem?

什么可能导致问题?

Similar to this question, but none of the solutions apply.

此问题类似,但没有任何解决方案适用。

回答by Jason

Figured it out. On the tab with three lines in a speech bubble, it shows a build log. I guess my storyboard file had become corrupt during the last git pull.

弄清楚了。在对话气泡中包含三行的选项卡上,它显示了构建日志。我猜我的故事板文件在上次 git pull 期间已经损坏。

回答by Jayprakash Dubey

You can see reasons for failure on Report Navigatorpresent in Navigator window.

您可以Report Navigator导航器窗口中查看失败的原因

  • Open Navigator by pressing Hide/Show Navigatorbutton present in top-left side of Xcode.
  • Hide/Show NavigatorXcode 左上角的按钮打开导航器。

Screenshot 1

截图 1

  • Open Report Navigatorby pressing last button present on list of buttons in Navigator window.
  • 打开Report Navigator按一次出现在导航器窗口的按钮列表按钮。

Screenshot 2

截图 2

Here you can view reasons either By Groupor By Time

您可以在此处查看原因By GroupBy Time

回答by kris

Click the last icon in the top bar of the left most panel in your Xcode window to reveal the secret Archivebuild errors.

单击 Xcode 窗口最左侧面板顶部栏中的最后一个图标以显示秘密存档构建错误。

enter image description here

在此处输入图片说明

It will likely be something related to code signing if you are able to build and run the app, but not Archive. Further googling of your error message should resolve that now that it has been revealed.

如果您能够构建和运行应用程序,而不是存档,则它可能与代码签名有关。进一步谷歌搜索您的错误消息应该可以解决这个问题,因为它已经被发现了。

回答by Sarathi S

Click the last icon in the top bar of the left most panel in your Xcode window to reveal the "secret" Archive build errors. I had permission issues which solved for me.

单击 Xcode 窗口最左侧面板顶部栏中的最后一个图标以显示“秘密”存档构建错误。我有权限问题为我解决了。

Xcode - Report Navigator

Xcode - 报告导航器

回答by Allan Scofield

If you changed the Build System to the new one, change back to the Standard. It solved for me.

如果您将 Build System 更改为新的,请改回 Standard。它为我解决了。

Build System

构建系统

回答by Mohamed Elkassas

Faced same issue with xCode 8 the reason was that my Apple Id session expired and xCode was not able to renew it because of network connection problems once i signed in with my Apple id in preferences. I was able to build normally again

遇到与 xCode 8 相同的问题,原因是我的 Apple Id 会话已过期,并且一旦我在首选项中使用我的 Apple ID 登录后,由于网络连接问题,xCode 无法更新它。我能够再次正常构建

回答by AsifHabib

I agree with Jason. You must did something wrong. It is Xcode's bug that it could not produce the error. Just move back on your path. Open screens you edited/opened last time. In My case ;was missing in one controller.

我同意杰森。你一定做错了什么。这是Xcode的错误,它无法产生错误。只是回到你的道路上。打开您上次编辑/打开的屏幕。在我的情况下;,缺少一个控制器。

回答by Denis Kutlubaev

This happened to me while I was writing in Swift 4.1in XCode 9.3. I use RxSwiftalso. It never happened while I was writing in Objective C. There were no any logs in Report Navigatortoo. Project just compiled without errors, then failed. Couldn't figure out why.

这发生在我Swift 4.1XCode 9.3. 我RxSwift也用。在我写作时它从未发生过Objective C。也没有任何登录Report Navigator。项目刚刚编译没有错误,然后失败了。无法弄清楚为什么。

In my case what I did and it helped:

就我而言,我所做的并有所帮助:

  1. Commit changes in Git and then discard changes in XCode if it shows "M" near files
  2. Clear derived data: Xcode -> Preferences -> location
  3. Clean build folder: Shift + Cmd + Alt + K
  4. Restart XCode
  1. 如果在文件附近显示“M”,则在 Git 中提交更改,然后在 XCode 中放弃更改
  2. 清除派生数据:Xcode -> Preferences -> location
  3. 清理构建文件夹:Shift + Cmd + Alt + K
  4. 重启 XCode

After this project tried to compile and showed errors. The error was here:

在此项目尝试编译并显示错误之后。错误在这里:

do {
    let jsonData = try JSONSerialization.data(withJSONObject: timingsDict, options: .prettyPrinted)
    let decoder = JSONDecoder()
    let pTiming = try decoder.decode(PTiming.self, from: jsonData)
    observer.onNext(timing)
    observer.onCompleted()
} catch {
    print(error.localizedDescription)
    observer.onError(error)
}

I passed wrong variable name in observer.onNext(timing). It should have been pTiming.

我在observer.onNext(timing). 应该是pTiming

回答by Burak

There might be no free disk space left.

可能没有剩余的可用磁盘空间。

回答by Seven Systems

This will also often happen if the "magical" macOS automatically restarts XCode after boot. That auto-started XCode instance will be completely broken. Quit and restart.

如果“神奇”的 macOS 在启动后自动重新启动 XCode,也会经常发生这种情况。那个自动启动的 XCode 实例将被完全破坏。退出并重新启动。