XCode 4.2.1 在启动时在 Lion 10.7.2 上崩溃

Posted

技术标签:

【中文标题】XCode 4.2.1 在启动时在 Lion 10.7.2 上崩溃【英文标题】:XCode 4.2.1 Crashes on Lion 10.7.2 on Launch 【发布时间】:2012-01-10 17:55:24 【问题描述】:

这周我买了大约 10 年来的第一台 Mac(是的!)。这是一台二手 Mac Pro(2x2GHz 双核 Xeon 和 2GB RAM)。它全新安装了 Mac OS X Lion 10.7.2。我只安装了 OmniOutlner Pro、Textmate 和 Ruby RVM。

我还从 App Store 下载并安装了 Xcode 4.2.1。起初,Xcode 运行良好(只是启动以查看它是否运行)。然后,第二天我启动 Xcode 开始使用它,它在启动时立即崩溃。从那以后,我尝试了很多方法来解决问题:重新启动、重新安装、重新下载和重新安装、删除和重新安装、删除 iTunes 和重新安装(早期的 Stack Overflow 回答建议这样做)等等。似乎没有任何帮助。有时我可以点击 XCode 中的菜单项(在显示崩溃消息时),但仅此而已。

其他一切似乎在这台机器上都能完美运行,所以我怀疑是硬件问题。我没有 OS X 安装 DVD。

我买了这个系统,所以我可以在 Xcode 中编程。如果你是我,你会怎么做?


UPDTE-1:这是问题详细信息和系统配置报告中的第一行(一般来说,我为这个问题查看的大部分似乎都在谈论 IDE Navigator日志):

Process:         Xcode [17619]
Path:            /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.2.1 (834)
Build Info:      IDEApplication-834000000000000~2
Code Type:       X86-64 (Native)
Parent Process:  launchd [118]

Date/Time:       2011-12-01 14:33:14.664 -0600
OS Version:      Mac OS X 10.7.2 (11C74)
Report Version:  9

Interval Since Last Report:          72258 sec
Crashes Since Last Report:           5
Per-App Interval Since Last Report:  719 sec
Per-App Crashes Since Last Report:   5
Anonymous UUID:                      1D22E753-40F6-4035-B53A-236881ED2A58

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 4D502
Encountered multiple assertions. First assertion was: ASSERTION FAILURE in /SourceCache/IDELogNavigator/IDELogNavigator-820/IDELogNavigator.m:582
Details:  (self.rootNavigableItem) should not be nil.
Object:   <IDELogNavigator: 0x4018f6420>
Method:   -revertStateWithDictionary:
Thread:   <NSThread: 0x40010a260>name = (null), num = 1
Hints:   
  0: Replacement view is installing: <IDELogNavigator: 0x4018f6420 representing: <DVTExtension 0x400d33120: Log Navigator (Xcode.IDEKit.Navigator.Logs) v0.1>>
Backtrace:
  0  0x00000001055c4366 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
  1  0x0000000104c3d1a4 _DVTAssertionFailureHandler (in DVTFoundation)
  2  0x000000010ad43cb1 -[IDELogNavigator revertStateWithDictionary:] (in IDELogNavigator)
  3  0x0000000104bffe5b -[DVTStateToken _pullStateFromDictionary:] (in DVTFoundation)
  4  0x0000000104bffc12 -[DVTStateToken pullStateFromRepository] (in DVTFoundation)
  5  0x000000010550f33d -[IDENavigatorArea replacementView:didInstallViewController:] (in IDEKit)
  6  0x0000000104df75f1 __42-[DVTReplacementView _setupViewController]_block_invoke_0 (in DVTKit)
  7  0x0000000104c00f4e DVTInvokeWithFailureHint (in DVTFoundation)
  8  0x0000000104df7473 -[DVTReplacementView _setupViewController] (in DVTKit)
  9  0x0000000104df7345 -[DVTReplacementView installedViewController] (in DVTKit)

UPDATE-2: 太糟糕了。我尝试了下面 Michael Dautermann 引用的方法,但没有奏效。这是我在终端中输入的内容:

sudo tmutil disablelocal
sudo /Developer/Library/uninstall-devtools --mode=all
sudo /Developer-old/Library/uninstall-devtools --mode=all
sudo /Developer-old-1/Library/uninstall-devtools --mode=all
sudo tmutil enablelocal

此时,/Developer、/Developer-old 和 /Developer-old-1 文件夹已被删除。然后我清空了垃圾箱并重新安装了 XCode。一切似乎都很顺利,但是当我启动 XCode 时,它​​立即又崩溃了 :-(

但是,还有三个额外的信息:

    XCode 崩溃时问题报告中的问题详细信息似乎与上面报告的问题详细信息基本相同。

    如果重要的话,安装的 XCode 版本是 XCode 4.2.1 Build 4D502。

    我现在注意到,如果我在 Internal Error 崩溃对话框中点击“继续”大约 15 次,XCode 就可以使用到探索菜单等的程度,并且似乎只显示如果我尝试退出,则会再次出现内部错误崩溃对话框。

如果有人有任何其他想法,我愿意尝试。我开始怀疑我是否在某个地方遇到了硬件问题,或者我是否应该降级到 Snow Leopard 和 XCode 3。

【问题讨论】:

每次都发生同样的崩溃(即,当您在将崩溃报告发送给 Apple 之前查看崩溃报告时)?如果每次都是同样的崩溃,您能否编辑您的问题以至少显示崩溃的前几行? 我已按照 Michael Dautermann 的要求将问题报告的输出添加到我的初始问题中。 我在上面添加了 Update-2 以记录我对 Michael Dautermann 在下面的答案中推荐的方法的尝试。这种方法失败了,但我在尝试中学到了一些东西。我仍在寻找解决方案。 【参考方案1】:
    下载 iPhone 配置实用程序...http://support.apple.com/kb/DL1465 安装、启动、退出实用程序。 Xcode 现在应该可以正确启动了。

【讨论】:

【参考方案2】:

卸载过程不包括您帐户的用户个人资料。卸载后,您还应该删除 ~/Library/Developer/Xcode。最简单的测试方法是创建一个新用户帐户并查看 Xcode 是否会打开。

【讨论】:

~/Library/Preferences/com.apple.Xcode.plistcom.apple.Xcode.LSSharedFileList.plist 中也有一些偏好可能值得丢弃。【参考方案3】:

如上所述,我的 Xcode 安装在启动时崩溃了。我下载并安装了 iPhone 配置实用程序 (ver3.4) 并运行了该实用程序。自从运行 iPhone 配置实用程序以来,Xcode 就已经启动并运行了。

【讨论】:

【参考方案4】:

我在 Google 上进行了搜索,发现有 a number of reports 和 people having crashes exactly like you described it。

这是 Andreas Schuderer on this Apple discussion thread 所述的潜在修复:

我遇到了同样的问题并在终端中输入:

sudo tmutil disablelocalsudo /Developer/Library/uninstall-devtools --mode=allsudo /Developer-3.2.2/Library/uninstall-devtools --mode=allsudo tmutil enablelocal

然后我删除了文件夹“Developer”和“Developer-3.2.2”。

然后我使用启动板上的安装程序重新安装了 xcode。现在它 有效。

P.S.:第一行和最后一行禁用和重新启用本地快照(a 时间机器的功能)。我遇到了 mtmd 处理的问题 占据了整个核心并导致我的 macbook pro 热得厉害。 tmutil 命令修复了这个问题。第三行是必要的,因为 xcode 安装程序已经备份了我以前的 xcode 版本。离开 如果不适用,这条线就出来了。

【讨论】:

无赖。我试过了,但没有用。这是我在终端中输入的内容: 抱歉,我还不太习惯 Stack Overflow 界面/流程。我尝试了上述方法。它失败了。我对我的尝试的笔记在上面的初始问题中描述为 Update-2。 嗨,克林特...当我 check out Apple's private devforums(如果您是付费 Apple Developer Connection 会员,我很确定您可以访问)时,我会看到各种像您一样的崩溃报告.我同意,如果您在使用 XCode 4 时遇到很多麻烦,请暂时回到 SnowLeopard 和 XCode 3(我个人会这样做),让我们看看 Apple 是否可以在这方面采取行动。【参考方案5】:

尝试按照 Update-2 中的说明再次卸载 XCode;然后下载并安装 iPhone 配置实用程序(本文发布时版本为 3.3)(http://support.apple.com/kb/dl851)。运行 iPhone 配置实用程序(位于 Applications/Utilities 文件夹中)。我不必对新的配置/设备/等做任何事情——只需启动应用程序。然后启动 XCode;然后我的开始正常工作了。

【讨论】:

【参考方案6】:

以上都不适合我。 XCode 在项目的摘要页面上崩溃。

问题源于我的 Info.plist 文件中的一个条目。我有三个特定的条目:IconIcon filesIcon files (ios 5)。我删除了最后一个,因为它是空的,这解决了问题。

【讨论】:

【参考方案7】:

这是我的修复方法:

    转到 -> 主页 -> 自动保存信息 -> 所有与 xcode 相关的文件都发送到垃圾箱

    Finder -> 清空垃圾桶

    苹果->重启

【讨论】:

以上是关于XCode 4.2.1 在启动时在 Lion 10.7.2 上崩溃的主要内容,如果未能解决你的问题,请参考以下文章

Xcode:Instruments 4.0 需要 Mac OS X 10.7 Lion?

如何在 Lion 下的 Xcode 4.1 Instruments 中启用 NSZombie?

在 Xcode 4 中使用 SVN 和 Mac OS X Lion (10.7)

如何卸载 Xcode 4.4 命令行工具(Mac OS X 10.8 Mountain Lion)?

使用 Xcode 4.6 在 Mac OS X Lion (10.8.2) 上安装 OpenCV [关闭]

Mountain Lion 上 xCode 4.5.1 中的 iOS 4 和 iOS 5 SDK