Xcode 8.2.1在打开数组索引超出范围的项目时崩溃


21

我刚刚升级到Xcode 8.2.1,每次使用以下回溯打开项目时,Xcode都会崩溃。我验证了旧版本的Xcode(8.1)仍可以打开项目文件。任何帮助将不胜感激。

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

Application Specific Information:
ProductBuildVersion: 8C1002
UNCAUGHT EXCEPTION (NSRangeException): *** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]
UserInfo: (null)
Hints: 
  0: Creation Backtrace for Notification Token:

  0   -[_DVTNotificationReceiver initWithBlock:queue:] (in DVTFoundation)
  1   -[NSNotificationCenter(DVTNSNotificationCenterAdditions) dvt_addObserverForName:object:queue:usingBlock:] (in DVTFoundation)
  2   -[_IDENavigatorOutlineViewDataSource setRootItems:] (in IDEKit)
  3   -[IDENavigatorOutlineView _updateRootItems:sortDescriptors:] (in IDEKit)
  4   -[IDENavigatorOutlineView setRootItems:] (in IDEKit)
  5   -[IDENavigatorOutlineView _updateBoundContentArrayOrSet] (in IDEKit)
  6   -[IDENavigatorOutlineView updateBoundContentArray] (in IDEKit)
  7   -[NSObject(DVTBindingUtilities) updateBoundValueForBinding:] (in DVTKit)
  8   -[DVTBindingHelper observeValueForKeyPath:ofObject:change:context:] (in DVTKit)
  9   NSKeyValueNotifyObserver (in Foundation)
 10   NSKeyValueDidChange (in Foundation)
 11   -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] (in Foundation)
 12   _NSSetObjectValueAndNotify (in Foundation)
 13   -[IDEBatchFindNavigator updateScopeItems:] (in IDEKit)
 14   __44-[IDEBatchFindNavigator setupLocationPicker]_block_invoke_2 (in IDEKit)
 15   -[NSObject(DVTObservingConvenience) _dvt_newObserverForKeyPath:options:owner:creationBacktrace:withHandlerBlock:] (in DVTFoundation)
 16   -[NSObject(DVTObservingConvenience) dvt_newObserverForKeyPath:options:withHandlerBlock:] (in DVTFoundation)
 17   -[IDEBatchFindNavigator setupLocationPicker] (in IDEKit)
 18   -[IDEBatchFindNavigator viewDidInstall] (in IDEKit)
 19   -[DVTViewController _viewDidInstall] (in DVTKit)
 20   -[_DVTViewController_ViewLifecycleInterpositions viewDidMoveToWindow] (in DVTKit)
 21   -[NSView _setWindow:] (in AppKit)
 22   -[NSView addSubview:] (in AppKit)
 23   __42-[DVTReplacementView _setupViewController]_block_invoke (in DVTKit)
 24   DVTInvokeWithFailureHint (in DVTFoundation)
 25   -[DVTReplacementView _setupViewController] (in DVTKit)
 26   -[DVTReplacementView installedViewController] (in DVTKit)
 27   -[DVTReplacementView layoutTopDown] (in DVTKit)
 28   -[DVTLayoutView_ML _reallyLayoutIfNeededTopDown] (in DVTKit)
 29   +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
 30   +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
 31   +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
 32   +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
 33   +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
 34   +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
 35   +[DVTLayoutView_ML _recursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:] (in DVTKit)
 36   -[DVTLayoutView_ML viewWillDraw] (in DVTKit)
 37   -[NSView viewWillDraw] (in AppKit)
 38   -[NSView viewWillDraw] (in AppKit)
 39   -[NSView viewWillDraw] (in AppKit)
 40   -[NSView _sendViewWillDrawInRect:clipRootView:] (in AppKit)
 41   -[NSView displayIfNeeded] (in AppKit)
 42   -[NSWindow displayIfNeeded] (in AppKit)
 43   ___NSWindowGetDisplayCycleObserver_block_invoke6365 (in AppKit)
 44   __37+[NSDisplayCycle currentDisplayCycle]_block_invoke (in AppKit)
 45   CA::Transaction::run_commit_handlers(CATransactionPhase) (in QuartzCore)
 46   CA::Context::commit_transaction(CA::Transaction*) (in QuartzCore)
 47   CA::Transaction::commit() (in QuartzCore)
 48   CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) (in QuartzCore)
 49   __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation)
 50   __CFRunLoopDoObservers (in CoreFoundation)
 51   CFRunLoopRunSpecific (in CoreFoundation)
 52   RunCurrentEventLoopInMode (in HIToolbox)
 53   ReceiveNextEventCommon (in HIToolbox)
 54   _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
 55   _DPSNextEvent (in AppKit)
 56   -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
 57   -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
 58   -[NSApplication run] (in AppKit)
 59   NSApplicationMain (in AppKit)
 60   start (in libdyld.dylib)

Backtrace:
  0   __exceptionPreprocess (in CoreFoundation)
  1   DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2   objc_exception_throw (in libobjc.A.dylib)
  3   -[__NSArrayM objectAtIndex:] (in CoreFoundation)
  4   -[_IDENavigatorOutlineViewDataSource outlineView:child:ofItem:] (in IDEKit)
  5   refreshRowEntryItemAndLevelInfo (in AppKit)
  6   -[NSOutlineView reloadItem:reloadChildren:] (in AppKit)
  7   -[IDENavigatorOutlineView reloadItem:reloadChildren:] (in IDEKit)
  8   __83-[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:]_block_invoke.735 (in IDEKit)
  9   +[NSAnimationContext(DVTNSAnimationContextAdditions) dvt_nonAnimatedBlock:] (in DVTKit)
 10   -[IDENavigatorOutlineView suspendEditingWhilePerformingBlock:] (in IDEKit)
 11   -[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:] (in IDEKit)
 12   DVTInvokeWithLazyFailureHint (in DVTFoundation)
 13   __48-[_DVTNotificationReceiver receiveNotification:]_block_invoke.42 (in DVTFoundation)
 14   -[_DVTNotificationReceiver receiveNotification:] (in DVTFoundation)
 15   __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ (in CoreFoundation)
 16   ___CFXRegistrationPost_block_invoke (in CoreFoundation)
 17   _CFXRegistrationPost (in CoreFoundation)
 18   ___CFXNotificationPost_block_invoke (in CoreFoundation)
 19   -[_CFXNotificationRegistrar find:object:observer:enumerator:] (in CoreFoundation)
 20   _CFXNotificationPost (in CoreFoundation)
 21   -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)
 22   -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] (in DVTFoundation)
 23   -[IDENavigableItemCoordinator _postNotificationNamed:forChangedItems:] (in IDEKit)
 24   -[IDENavigableItemCoordinator _delayedPostGraphAndPropertyChangeNotifications] (in IDEKit)
 25   __48-[DVTDelayedInvocation initWithTarget:selector:]_block_invoke (in DVTFoundation)
 26   -[DVTDelayedInvocation runBlock:] (in DVTFoundation)
 27   __NSFirePerformWithOrder (in Foundation)
 28   __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation)
 29   __CFRunLoopDoObservers (in CoreFoundation)
 30   __CFRunLoopRun (in CoreFoundation)
 31   CFRunLoopRunSpecific (in CoreFoundation)
 32   RunCurrentEventLoopInMode (in HIToolbox)
 33   ReceiveNextEventCommon (in HIToolbox)
 34   _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
 35   _DPSNextEvent (in AppKit)
 36   -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
 37   -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
 38   -[NSApplication run] (in AppKit)
 39   NSApplicationMain (in AppKit)
 40   start (in libdyld.dylib)

abort() called

Application Specific Signatures:
NSRangeException

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff9993a452 __exceptionPreprocess + 178
1   DVTFoundation                       0x0000000106127762 DVTFailureHintExceptionPreprocessor + 194
2   libobjc.A.dylib                     0x00007fff882b8f7e objc_exception_throw + 48
3   CoreFoundation                      0x00007fff99851725 -[__NSArrayM objectAtIndex:] + 245
4   IDEKit                              0x000000010776c830 -[_IDENavigatorOutlineViewDataSource outlineView:child:ofItem:] + 190
5   AppKit                              0x00007fff86d092e5 refreshRowEntryItemAndLevelInfo + 327
6   AppKit                              0x00007fff86d02f67 -[NSOutlineView reloadItem:reloadChildren:] + 3024
7   IDEKit                              0x0000000107767d7b -[IDENavigatorOutlineView reloadItem:reloadChildren:] + 357
8   IDEKit                              0x000000010776ac2e __83-[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:]_block_invoke.735 + 522
9   DVTKit                              0x000000010685464f +[NSAnimationContext(DVTNSAnimationContextAdditions) dvt_nonAnimatedBlock:] + 132
10  IDEKit                              0x0000000107765441 -[IDENavigatorOutlineView suspendEditingWhilePerformingBlock:] + 101
11  IDEKit                              0x000000010776a76d -[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:] + 2226
12  DVTFoundation                       0x0000000106127576 DVTInvokeWithLazyFailureHint + 100
13  DVTFoundation                       0x00000001060e1f32 __48-[_DVTNotificationReceiver receiveNotification:]_block_invoke.42 + 149
14  DVTFoundation                       0x00000001060e1c7f -[_DVTNotificationReceiver receiveNotification:] + 1054
15  CoreFoundation                      0x00007fff998c5b1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
16  CoreFoundation                      0x00007fff998c5aaf ___CFXRegistrationPost_block_invoke + 63
17  CoreFoundation                      0x00007fff998c5a27 _CFXRegistrationPost + 407
18  CoreFoundation                      0x00007fff998c5792 ___CFXNotificationPost_block_invoke + 50
19  CoreFoundation                      0x00007fff99882542 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
20  CoreFoundation                      0x00007fff99881795 _CFXNotificationPost + 693
21  Foundation                          0x00007fff9718e17a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
22  DVTFoundation                       0x00000001060e338a -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] + 360
23  IDEKit                              0x000000010794c00f -[IDENavigableItemCoordinator _postNotificationNamed:forChangedItems:] + 542
24  IDEKit                              0x000000010794c35d -[IDENavigableItemCoordinator _delayedPostGraphAndPropertyChangeNotifications] + 713
25  DVTFoundation                       0x0000000105ef15a8 __48-[DVTDelayedInvocation initWithTarget:selector:]_block_invoke + 79
26  DVTFoundation                       0x0000000105ef298b -[DVTDelayedInvocation runBlock:] + 257
27  Foundation                          0x00007fff9726884a __NSFirePerformWithOrder + 339
28  CoreFoundation                      0x00007fff998cefc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
29  CoreFoundation                      0x00007fff998cef37 __CFRunLoopDoObservers + 391
30  CoreFoundation                      0x00007fff998ae408 __CFRunLoopRun + 872
31  CoreFoundation                      0x00007fff998ade38 CFRunLoopRunSpecific + 296
32  HIToolbox                           0x00007fff87c2b935 RunCurrentEventLoopInMode + 235
33  HIToolbox                           0x00007fff87c2b76f ReceiveNextEventCommon + 432
34  HIToolbox                           0x00007fff87c2b5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
35  AppKit                              0x00007fff869a2df6 _DPSNextEvent + 1067
36  AppKit                              0x00007fff869a2226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
37  DVTKit                              0x00000001066d1eaf -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 396
38  AppKit                              0x00007fff86996d80 -[NSApplication run] + 682
39  AppKit                              0x00007fff86960368 NSApplicationMain + 1176
40  libdyld.dylib                       0x00007fff94a015ad start + 1
41  ???                                 0x0000000000000001 0x0 + 1

1
对我来说...删除衍生数据内容有效!
Jayprakash Dubey

@JayprakashDubey它将起作用,直到您几次单击“查找导航器”,然后再次崩溃,并且您将不得不再次清理派生的数据,依此类推...非常有问题的版本。
旋风

Answers:


19

好的,我设法通过删除.xcworkspace目录并通过创建它来解决此问题pod install。Xcode打开,我能够构建我的项目。

编辑:正如其他人所建议的,更好的解决方案是从.xcworkspace中删除xcuserdata目录。由于不需要每次都重新运行pod安装,因此速度更快。


5
通过打开.xcworkspace目录(显示pakcage内容),然后消除xcuserdata文件夹,我也能够“解决”该问题(在强制进行xcode更新之后)。
卢卡斯(Lukasz'Severiaan'Grela)

Lukasz'Severiaan'Grela,谢谢您的回答。它解决了我的问题。
ZevsVU

13

正确的答案来自卢卡兹的评论

  1. 右键单击文件.xcworkspace> 显示包装内容
  2. 删除xcuserdata文件夹

现在,Xcode可以很好地打开项目工作区。


这与@Eric答案相同
Jayprakash Dubey

1
@Jayprakash在我添加答案后,他直接编辑了答案。他的编辑时间是世界标准时间20:17:4,答案发布在世界标准时间19:52:17。
ChrisJF'2

这也可能起作用。但是如果一段时间后问题又回来了(通常是在使用“查找导航器”时)。
旋风

我认为您需要提出第三点:3.运行pod install / update。谢谢
Jordan Montel

此方法有效。我尝试重新启动整个MacOS,但没有成功。
AechoLiu

6

对于其他遇到类似问题的用户,但这仅在在导航器区域中切换“查找导航器”时才会发生。尝试单击项目导航器,或者CMD + 1在启动时反复单击。听起来很有趣,但是有效。


仅供参考,它可能在前几次失败。
funct7

是的,有点可笑,但大多是悲伤的。我遇到了同样的问题,如果我不使用“查找导航器”,则根本不会崩溃。不幸的是,此版本的Xcode占用大量时间。
旋风

1

除了删除xcuserdata项目工作区目录中的文件夹之外,我还能够通过删除位于的派生数据(对于Xcode崩溃时打开的项目或所有项目)来纠正这种特殊的崩溃~/Library/Developer/Xcode/DerivedData。上一次Xcode崩溃时,我必须同时做这两项工作才能再次启动Xcode,所以我认为删除这两项是最安全的选择(至少目前如此)。


0
  • 是的,删除xcuserdata会有所帮助。
  • 我曾经擦除“派生数据”,但是如果我尝试在重新建立索引之前执行任何操作,它将在重新打开时立即再次崩溃。
  • 我注意到这只发生在我在家和工作中编辑的个人项目上。
  • 两者的用户名不同,因此我在xcuserdata中输入了2个用户条目,即工作登录用户名和家庭用户名。
  • 我注意到两者都有断点。
  • 引发的错误是_IDENavigatorOutlineViewDataSource,所以它在Xcode的LHS侧面板上有问题吗?
  • 您可以在不弄乱工作区的情况下为xcuserdata添加.ignore吗?

在此处输入图片说明

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.