xcode 无法编译 iOS 应用程序,打开 .xib 或 .storyboard 文件时会崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9109571/
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
xcode won't compile iOS apps, crashes when .xib or .storyboard files are opened
提问by markstewie
I'm running the very latest version of xcode (4.2.1). And I'm signed up to the ios developer program.
我正在运行最新版本的 xcode (4.2.1)。我已经注册了 ios 开发者计划。
When I create a new iOS Application for iPhone or iPad, using storyboards or not it doesn't seem to matter, xcode crashes on me when I try to open the .xib or .storyboard files.
当我为 iPhone 或 iPad 创建一个新的 iOS 应用程序时,使用与否似乎无关紧要,当我尝试打开 .xib 或 .storyboard 文件时,xcode 会崩溃。
Here is the error provided when I click on the storyboard file before it crashes.
这是我在崩溃之前单击情节提要文件时提供的错误。
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-933/IB Plugin/Utilities/IBObjectMarshalling.m:179
Details: Interface Builder encountered an error communicating with the iOS Simulator. "Interface Builder Cocoa Touch Tool" (54332) failed to launch and exited with status (null), signal 10. Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Function: NSDistantObject<IBCocoaTouchToolProtocol> *IBAttachToCocoaTouchTool(IBCocoaTouchTargetRuntime *)
Thread: <NSThread: 0x40010a260>{name = (null), num = 1}
Something to do with the iOS simulator? Exactly the same message appears when I try open an .xib file.
与iOS模拟器有关吗?当我尝试打开 .xib 文件时,会出现完全相同的消息。
When I try to run or test a project I get an error when it tries to compile the storyboard or xib files. eg
当我尝试运行或测试项目时,在尝试编译故事板或 xib 文件时出现错误。例如
CompileXIB EmptyViewTest/en.lproj/com_markstewart_comViewController.xib
cd /Users/mark/Sites/_iOS/EmptyViewTest/EmptyViewTest
setenv IBC_MINIMUM_COMPATIBILITY_VERSION 5.0
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv XCODE_DEVELOPER_USR_PATH /Developer/usr/bin/..
/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile /Users/mark/Library/Developer/Xcode/DerivedData/EmptyViewTest-dxxqhrayajehooezj flgyjqysqkp/Build/Products/Debug-iphonesimulator/EmptyViewTest.app/en.lproj/com_ markstewart_comViewController.nib /Users/mark/Sites/_iOS/EmptyViewTest/EmptyViewTest/EmptyViewTest/en.lproj/com_m arkstewart_comViewController.xib --sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0 .sdk
Please help! How do I get this to work again?
请帮忙!我怎样才能让它再次工作?
I've since totally uninstalled and re-installed developer tools. Same problem still occurs. It seems to be something to do with the iphone simulator as when I try to run the simulator app by itself it instantly crashes too. (see attached screenshot). What is going on?! :(
我已经完全卸载并重新安装了开发人员工具。同样的问题仍然出现。这似乎与 iphone 模拟器有关,因为当我尝试单独运行模拟器应用程序时,它也会立即崩溃。(见附件截图)。到底是怎么回事?!:(
----- UPDATE 2
----- 更新2
Still having this problem! I can sometimes build applications, but as soon as I click on either the .xib or .storyboard file (in separate projects) xcode crashes. When they do succeed I get the error above that the simulator has issues locating the SDK.
还是有这个问题!我有时可以构建应用程序,但是一旦我单击 .xib 或 .storyboard 文件(在单独的项目中),xcode 就会崩溃。当他们成功时,我得到上面的错误,模拟器在定位 SDK 时出现问题。
I've uninstalled and reinstalled xcode about five times now and the same issues keeps occurring.
我现在已经卸载并重新安装了 xcode 大约五次,同样的问题不断发生。
Here is the crash report from the "Interface Builder Cocoa Touch Tool" error. If it makes sense to anyone? Crash Report
这是来自“Interface Builder Cocoa Touch Tool”错误的崩溃报告。如果这对任何人都有意义?崩溃报告
Does anyone have any other ideas? Starting to get pretty desperate.
有没有人有其他想法?开始变得非常绝望。
回答by Flori
did you installed TotalFinder?
你安装了TotalFinder吗?
I had the same problem caused by TotalFinder's Asepsisfeature.
我不得不引起TotalFinder的同样的问题无菌功能。
Asepsis current Version (1.1) Conflicts with Xcode 4.2 and Glims (see image).
Asepsis 当前版本 (1.1) 与 Xcode 4.2 和 Glims 冲突(见图)。
The Website lists this known issue:
该网站列出了这个已知问题:
Xcode 4.2, iOS 5.0 Simulator
Some developers reported that Asepsis breaks iOS 5.0 Simulator and causes Xcode 4.2 fail in loading XIB files
Xcode 4.2, iOS 5.0 模拟器
一些开发人员报告说,Asepsis 破坏了 iOS 5.0 模拟器并导致 Xcode 4.2 无法加载 XIB 文件
to uninstall just run this command from Terminal:
卸载只需从终端运行此命令:
sudo open /System/Library/Extensions/Asepsis.kext/Contents/Resources/Asepsis\ Uninstaller.app
回答by jhilgert00
I had this same problem and deleting everything in your "Derived Data" folder fixed my issues. In your case: /Users/mark/Library/Developer/Xcode/DerivedData/EmptyViewTest
我遇到了同样的问题,删除“派生数据”文件夹中的所有内容都解决了我的问题。在您的情况下:/Users/mark/Library/Developer/Xcode/DerivedData/EmptyViewTest
Maybe this thread will help: How can I safely delete in my ~/Library/Developer/Xcode/DerivedData directory?
也许这个线程会有所帮助: 如何在我的 ~/Library/Developer/Xcode/DerivedData 目录中安全地删除?
回答by Jeshua Lacock
I hate to say it, but it sounds like you may need to do a clean system install followed by a clean XCode install.
我不想这么说,但听起来您可能需要先安装干净的系统,然后再安装干净的 XCode。
Or do you have another machine you can try a clean install of XCode on first?
或者您是否有另一台机器可以先尝试全新安装 XCode?
If you can't just create a new project and run it in the simulator without it crashing you either have an issue with XCode or with your system. Since reinstalling XCode you still have an issue, I am afraid that leaves your system in question.
如果您不能只是创建一个新项目并在模拟器中运行它而不会崩溃,那么您可能会遇到 XCode 或系统问题。自从重新安装 XCode 后,您仍然有问题,恐怕这会使您的系统出现问题。
回答by quellish
Try removing (you can try just moving them rather than deleting them) these user directories. Make sure your developer tools are not running when you do this.
尝试删除(您可以尝试仅移动它们而不是删除它们)这些用户目录。执行此操作时,请确保您的开发人员工具未运行。
~/Library/Application\ Support/iPhone\ Simulator
~/Library/Application\ Support/Developer
~/Library/Developer
These directories are particular to your user.
这些目录特定于您的用户。
回答by Stephen Darlington
It's a pretty fundamental problem and so unlikely it's anything you're doing wrong. I'd suggest reinstalling Xcode. If that doesn't work, try uninstalling it first and install it again. (Bit of a pain, sorry. Stock up on coffee first.)
这是一个非常基本的问题,所以不太可能是你做错了什么。我建议重新安装Xcode。如果这不起作用,请先尝试将其卸载并重新安装。(有点痛,抱歉。先储备咖啡。)
回答by allen.bang
I have same problem within xcode4.5 and iOS6. When I startup iOS simulator 6, it always report "The simulated application quit" and ask me to switch SDKS. Whatever I choose the right location of SDK5.0 or SDK6.0 for the simulator, the problem is still here. So I can't run even a simplest program with SDK6.0, but the old projects with SDK5.0 are ok.
我在 xcode4.5 和 iOS6 中有同样的问题。启动iOS模拟器6时,老是提示“模拟应用退出”,要求我切换SDK。无论我为模拟器选择SDK5.0还是SDK6.0的正确位置,问题仍然存在。所以我连最简单的程序用SDK6.0都跑不起来,但是用SDK5.0的老项目还可以。
I don't why, because it works well before today. So I follow @quellish's way, close xcode and simulator, remove these directory in my finder: ~/Library/Application\ Support/iPhone\ Simulator ~/Library/Application\ Support/Developer ~/Library/Developer
我不知道为什么,因为它在今天之前运行良好。所以我按照@quellish 的方式,关闭 xcode 和模拟器,在我的查找器中删除这些目录:~/Library/Application\ Support/iPhone\ Simulator ~/Library/Application\ Support/Developer ~/Library/Developer
Then run Xcode again, everything goes ok again! thanks quellish!
然后再次运行Xcode,一切又正常了!谢谢平息!
I think some files in these directory was broken, so the strange problem happened. If someone know exactly why it happened, it's appreciate you can tell me.
我认为这些目录中的某些文件已损坏,因此发生了奇怪的问题。如果有人确切地知道它发生的原因,很感激你能告诉我。