安装 Xcode 7 后,我无法再构建和运行项目,因为文档无法打开

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

After installing Xcode 7 I can't build and run projects anymore as document fails to open

iosxcodexcode7

提问by mm24

EDIT: This question refers to teh pre-release version of Xcode 7, hence it may not be relevant if you are running the currently released version as some issues may have been fixed.

编辑:这个问题是指 Xcode 7 的预发布版本,因此如果您正在运行当前发布的版本,它可能无关紧要,因为某些问题可能已得到修复。



I get the following:

我得到以下信息:

Failed to connect with the iOS agent. Please file a bug report at bugreport.apple.com.

无法与 iOS 代理连接。请在 bugreport.apple.com 上提交错误报告。

enter image description here

在此处输入图片说明

Why is that?

这是为什么?

If I look at the details I get:

如果我查看详细信息,我会得到:

=================================

ERROR:

Failed to find or create execution context for description System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity (Failure reason: Software caused connection abort): Failed to find newest available Simulator runtime (Failure reason: Software caused connection abort): Simulator verification failed. (Failure reason: A connection to the simulator verification service could not be established.)

Error Domain=NSPOSIXErrorDomain Code=53 "Failed to find or create execution context for description System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity" UserInfo=0x7fcf5961ebd0 {NSLocalizedDescription=Failed to find or create execution context for description System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity, NSUnderlyingError=0x7fcf58b72950 "Failed to find newest available Simulator runtime"}

==================================

错误:

无法找到或创建用于描述的执行上下文 IBCCoaTouchFramework-EightAndLater 的系统内容 1x 具有默认保真度(失败原因:软件导致连接中止):无法找到最新的可用模拟器运行时(失败原因:软件导致连接中止):模拟器验证失败. (失败原因:无法建立与模拟器验证服务的连接。)

错误域=NSPOSIXErrorDomain 代码=53“无法找到或创建 IBCocoaTouchFramework-EightAndLater w/默认保真度的描述系统内容 1x 的执行上下文” UserInfo=0x7fcf5961ebd0 {NSLocalizedDescription=无法找到或创建描述系统内容 1x 的执行上下文 IBCocoaTouchFramework- EightAndLater w/默认保真度,NSUnderlyingError=0x7fcf58b72950“未能找到最新的可用模拟器运行时”}

采纳答案by mm24

I am not sure which answer to accept as for me what worked was installing a later beta (beta 5). I had filed a bug to Apple a couple of months ago so I assume they solved this problem by updating Xcode.

我不确定要接受哪个答案,对我来说安装以后的测试版(测试版 5)有效。几个月前我向 Apple 提交了一个错误,所以我认为他们通过更新 Xcode 解决了这个问题。

Anyone experiencing this with the current official release?

有没有人在当前的官方版本中遇到过这种情况?

I post this as answer for now but if anyone has a more detailed explanation I will be happy to remove my answer and accept yours.

我现在将此作为答案发布,但如果有人有更详细的解释,我将很乐意删除我的答案并接受您的答案。

回答by ryguy

I ran into the same issue with xcode 7 beta 3.

我在使用 xcode 7 beta 3 时遇到了同样的问题。

I had my deployment target set to 8.3. Setting it to 9.0, cleaning the build, and restarting xcode worked for me.

我将部署目标设置为 8.3。将其设置为 9.0,清理构建并重新启动 xcode 对我有用。

回答by Robert J. Clegg

It seems this is a common issue. Found an answer over at Apple's developer forums:

似乎这是一个普遍的问题。在 Apple 的开发者论坛上找到了答案:

https://forums.developer.apple.com/thread/11706

https://forums.developer.apple.com/thread/11706

In case the link goes dead or you have no access, this is the accepted answer:

如果链接失效或您无权访问,这是公认的答案:

Correct Answer by seancook on Jul 21, 2015 5:58 PM

I experienced this, too, on El Capitan. NIBs wouldn't load, no Sims present, and unable to launch Simulators through the Xcode/Open Developer Tool/Simulator menu. After fighting it for a few hours I've finally got it working. Here's what worked for me (YMMV): I noticed a message in Console.app along the lines of the Simulator runtime not being code signed. I went to the path it described "/Library/Developer/CoreSimulator/Profiles/Runtimes" and removed the runtimes that I had there. They were old runtimes, so I assume that some check in Xcode now applies that didn't previously. Who knows?
After doing this, I could finallylaunch the Simulator via the Xcode/Open Developer Tool menu. Unfortunately, the Simulator still wasn't being shown as a run target in my workspace, so I kept spelunking... I then went into the Simulator's Hardware/Devices/Manage Devices menu and added a new iOS9 device. It didn't seem to do anything, so I quit out of Xcode and Simulator.app. I then re-started Simulator.app (via Xcode/ODT/Simulator) and lo and behold the expected iOS9 simulators were displayed. I closed and re-opened Xcode, changed the target OS for my project, and the Sims were finally displayed as run targets.

HTH.

seacook 于 2015 年 7 月 21 日下午 5:58 的正确答案

我在 El Capitan 也经历过这种情况。NIB 无法加载,没有 Sims,并且无法通过 Xcode/Open Developer Tool/Simulator 菜单启动 Simulators。经过几个小时的斗争,我终于让它工作了。这对我有用 (YMMV):我注意到 Console.app 中的一条消息沿着模拟器运行时没有被代码签名。我去了它描述的路径“/Library/Developer/CoreSimulator/Profiles/Runtimes”并删除了我在那里的运行时。它们是旧的运行时,所以我假设 Xcode 中的一些检查现在适用,而以前没有。谁知道?
这样做之后,我终于可以通过 Xcode/Open Developer Tool 菜单启动模拟器。不幸的是,模拟器仍然没有在我的工作区中显示为运行目标,所以我一直在探索......然后我进入模拟器的硬件/设备/管理设备菜单并添加了一个新的 iOS9 设备。它似乎没有做任何事情,所以我退出了 Xcode 和 Simulator.app。然后我重新启动了 Simulator.app(通过 Xcode/ODT/Simulator),瞧,显示了预期的 iO​​S9 模拟器。我关闭并重新打开 Xcode,更改了我项目的目标操作系统,最终模拟人生显示为运行目标。

哈。

回答by Ants

I got this error on with Xcode 7.0 release build (7A220). I was running on device too not using the simulator at all.

我在 Xcode 7.0 release build (7A220) 上遇到了这个错误。我也在设备上运行,根本没有使用模拟器。

I did a full clean Clean build folder...option, close Xcode and then opened up Activity Monitor. I found a bunch of Ibtoolprocesses running. I terminated all of these and restart Xcode.

我做了一个完全干净的Clean build folder...选项,关闭 Xcode,然后打开 Activity Monitor。我发现一堆Ibtool进程正在运行。我终止了所有这些并重新启动 Xcode。

All going again!

一切又开始了!

回答by orlandob11

Try deleting and reinstalling your Xcode beta, it worked for me on Xcode beta 3

尝试删除并重新安装您的 Xcode beta,它在 Xcode beta 3 上对我有用

回答by Danoli3

Verify you have the latest Xcode Beta installation with Xcode-beta open click "About Xcode" and check the build number.

验证您安装了最新的 Xcode Beta,打开 Xcode-beta 单击“About Xcode”并检查内部版本号。

Then check the Current build number of the latest Xcode-beta on the Xcode Downloads Page:

然后在 Xcode 下载页面上检查最新 Xcode-beta 的当前版本号:

https://developer.apple.com/xcode/downloads/

https://developer.apple.com/xcode/downloads/

回答by Emrah Akgül

First of all, your stack trace does not show anything relevant with the answer which I found, however, my stack trace also seemed me irrelevant. But it worked for me and hope that works for you:

首先,您的堆栈跟踪没有显示与我找到的答案相关的任何内容,但是,我的堆栈跟踪似乎与我无关。但它对我有用,希望对你有用:

Someone from Apple staff gave the answer at: https://forums.developer.apple.com/thread/3978

苹果工作人员给出了答案:https: //forums.developer.apple.com/thread/3978

What was said is "We saw this in the labs at WWDC. The crash was caused by an offending custom color picker. Try removing any custom color pickers you have installed on your system"

所说的是“我们在 WWDC 的实验室中看到了这一点。崩溃是由有问题的自定义颜色选择器引起的。尝试删除您在系统上安装的所有自定义颜色选择器”

In brief, delete related color picker from your system, close the xcode and relaunch.

简而言之,从系统中删除相关的颜色选择器,关闭 xcode 并重新启动。

回答by xarly

Another things I would check it's what command line you are using.?

我要检查的另一件事是您使用的是什么命令行。?

I had to use a different version and I changed them with :?

我不得不使用不同的版本,我用 :?

sudo xcode-select --switch /Applications/Xcode8.app/Contents/Developer/

( You can also change it in the XCode/Preferences/Location )?

(您也可以在 XCode/Preferences/Location 中更改它)?

I think my problem was that I was using the version 8.1?

我想我的问题是我使用的是 8.1 版?

You can see the comand line you are using with:?

您可以看到您正在使用的命令行:?

xcode-select -p