題:
Xcode 8.2.1在打開數組索引超出範圍的項目時崩潰
Eric Conner
2016-12-21 08:20:11 UTC
view on stackexchange narkive permalink

我剛剛升級到Xcode 8.2.1,每次使用以下回溯打開項目時,Xcode都會崩潰。我驗證了舊版本的Xcode(8.1)仍可以打開項目文件。任何幫助將不勝感激。

 異常類型:EXC_CRASH(SIGABRT)
異常代碼:0x0000000000000000、0x0000000000000000
異常說明:EXC_CORPSE_NOTIFY

特定於應用程序的信息:
產品構建版本:8C1002
意外例外(NSRangeException):***-[__ NSArrayM objectAtIndex:]:索引3超出範圍[0 .. 2]
UserInfo :(空)
提示:
  0:通知令牌的創建回溯:

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

回溯:
  0 __exceptionPreprocess(在CoreFoundation中)
  1個DVTFailureHintExceptionPreprocessor(在DVTFoundation中)
  2 objc_exception_throw(在libobjc.A.dylib中)
  3-[__ NSArrayM objectAtIndex:](在CoreFoundation中)
  4-[_ IDENavigatorOutlineViewDataSource outlineView:child:ofItem:](在IDEKit中)
  5 refreshRowEntryItemAndLevelInfo(在AppKit中)
  6-[NSOutlineView reloadItem:reloadChildren:](在AppKit中)
  7-[IDENavigatorOutlineView reloadItem:reloadChildren:](在IDEKit中)
  8 __83-[_ IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:] _ block_invoke.735(在IDEKit中)
  9 + [NSAnimationContext(DVTNSAnimationContextAdditions)dvt_nonAnimatedBlock:](在DVTKit中)
10-[IDENavigatorOutlineViewsuspendEditingWhilePerformingBlock:](在IDEKit中)
 11-[_ IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:](在IDEKit中)
 12 DVTInvokeWithLazyFailureHint(在DVTFoundation中)
 13 __48-[_ DVTNotificationReceiver receiveNotification:] _ block_invoke.42(在DVTFoundation中)
 14-[_ DVTNotificationReceiver receiveNotification:](在DVTFoundation中)
 15 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__(在CoreFoundation中)
 16 ___ CFXRegistrationPost_block_invoke(在CoreFoundation中)
 17 _CFXRegistrationPost(在CoreFoundation中)
 18 ___ CFXNotificationPost_block_invoke(在CoreFoundation中)
 19-[_ CFXNotificationRegistrar find:object:observer:enumerator:](在CoreFoundation中)
 20 _CFXNotificationPost(在CoreFoundation中)
 21-[NSNotificationCenter postNotificationName:object:userInfo:](在Foundation中)
 22-[NSNotificationCenter(DVTNSNotificationCenterAdditions)_dvt_postNotificationName:object:userInfo:](在DVTFoundation中)
 23-[IDENavigableItemCoordinator _postNotificationNamed:forChangedItems:](在IDEKit中)
 24-[IDENavigableItemCoordinator _delayedPostGraphAndPropertyChangeNotifications](在IDEKit中)
 25 __48- [DVTDelayedInvocation initWithTarget:selector:] _ block_invoke(在DVTFoundation中)
 26-[DVTDelayedInvocation runBlock:](在DVTFoundation中)
 27 __NSFirePerformWithOrder(在基礎中)
 28 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__(在CoreFoundation中)
 29個__CFRunLoopDoObservers(在CoreFoundation中)
 30 __CFRunLoopRun(在CoreFoundation中)
 31 CFRunLoopRunSpecific(在CoreFoundation中)
 32 RunCurrentEventLoopInMode(在HIToolbox中)
 33 ReceiveNextEventCommon(在HIToolbox中)
 34 _BlockUntilNextEventMatchingListInModeWithFilter(在HIToolbox中)
 35 _DPSNextEvent(在AppKit中)
 36-[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:](在AppKit中)
 37-[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:](在DVTKit中)
 38-[NSApplication運行](在AppKit中)
39 NSApplicationMain(在AppKit中)
 40開始(在libdyld.dylib中)

abort()被調用

專用簽名:
NSRangeException

特定應用回溯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-[IDENavigatorOutlineViewsuspendEditingWhilePerformingBlock:] + 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查找:對象:觀察者:枚舉器:] + 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基礎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運行] + 682
39 AppKit 0x00007fff86960368 NSApplicationMain + 1176
40 libdyld.dylib 0x00007fff94a015ad開始+ 1
41 ???0x0000000000000001 0x0 + 1
 
對我來說...刪除衍生數據內容有效!
@JayprakashDubey它將起作用,直到您幾次單擊“查找導航器”,然後再次崩潰,並且您將不得不再次清除派生數據,依此類推...非常有問題的版本。
五 答案:
Eric Conner
2016-12-22 00:30:11 UTC
view on stackexchange narkive permalink

好的,我設法通過刪除.xcworkspace目錄並通過 pod install 重新創建了此問題。Xcode打開,我能夠構建我的項目。

Edit: 正如其他人所建議的,一個更好的解決方案是從.xcworkspace中刪除xcuserdata目錄。這樣比較快,因為您不需要每次都重新運行pod安裝。

通過打開.xcworkspace目錄(顯示pakcage內容),我還能夠“解決”該問題(在強制進行xcode更新之後),然後擺脫了xcuserdata文件夾。
Lukasz'Severiaan'Grela,謝謝您的回答。它解決了我的問題。
ChrisJF
2017-02-01 01:52:18 UTC
view on stackexchange narkive permalink

正確答案來自盧卡茲的評論

  1. R右鍵單擊文件 .xcworkspace 上的> 顯示包內容
  2. Delete xcuserdata 文件夾
  3. ol>

    現在Xcode將打開項目工作區。

這與@Eric答案相同
-1
這也可能起作用。但是如果一段時間後問題又回來了(通常是在使用“查找導航器”時)。
我認為您需要提出第三點:3.運行pod install / update。 謝謝
此方法有效。我嘗試重新啟動整個MacOS,但沒有成功。
這個對我有用。 謝謝!!!
funct7
2017-01-10 07:26:40 UTC
view on stackexchange narkive permalink

對於其他遇到類似問題的用戶,但這僅在在導航器區域中切換“查找導航器”時才會發生。嘗試在啟動時反复單擊Project Navigator或 CMD + 1 。聽起來很有趣,但是有效。

僅供參考,它可能在前幾次失敗。
是的,有點可笑,但大多是悲傷的。我遇到了同樣的問題,如果我不使用“查找導航器”,它根本不會崩潰。不幸的是,此版本的Xcode佔用大量時間。
Lubo
2017-02-01 15:56:00 UTC
view on stackexchange narkive permalink

除了刪除項目工作區目錄中的 xcuserdata 文件夾外,我還能夠通過刪除派生數據(對於Xcode崩潰時打開的項目或所有項目)來糾正這種特定的崩潰。),位於〜/ Library / Developer / Xcode / DerivedData 。上一次Xcode崩潰時,我必須做兩件事才能再次啟動Xcode,所以我認為刪除這兩項是您最安全的選擇(至少現在是這樣)。

brian.clear
2017-02-21 18:19:45 UTC
view on stackexchange narkive permalink
  • 是的,刪除xcuserdata會有所幫助。
  • 我曾經擦除過衍生數據,但是 如果我嘗試執行任何操作,它將立即在重新打開時再次崩潰 在重新完成索引之前。
  • 我注意到這只發生在 我在家里和工作中編輯的個人項目。
  • 用戶名是 兩者都不同,所以我最終在xcuserdata中輸入了2個用戶條目 工作登錄用戶名和我的家庭用戶名。
  • 我注意到兩者都有 斷點。
  • 引發的錯誤是 _IDENavigatorOutlineViewDataSource,以便它在Xcode的LHS側面板上顯示嗎?
  • 是否可以為xcuserdata添加.ignore而不會造成混亂 一個工作區?

enter image description here



該問答將自動從英語翻譯而來。原始內容可在stackexchange上找到,我們感謝它分發的cc by-sa 3.0許可。
Loading...