LoginSignup
3
1

More than 5 years have passed since last update.

プロジェクトを開いたり、アプリをrunすると "Xcodeが予期しない理由で終了しました。" となる

Posted at

開発していたらXcodeがクラッシュするようになったのでメモ書き。

環境

Xcode 8.2.1
Swift 2.3 のプロジェクト

現象その1

特定のプロジェクトを開いただけで、"Xcodeが予期しない理由で終了しました。" となる。
他のプロジェクトは正常に開ける。
スクリーンショット 2017-01-19 13.03.48.png

解決方法 for 現象その1

  • Derived Data を削除することで改善した。
rm -r ~/Library/Developer/Xcode/DerivedData/

現象その2

無事プロジェクトが開いて、アプリを run すると
スクリーンショット 2017-01-19 13.24.40.png

"Xcodeが予期しない理由で終了しました。" となる
スクリーンショット 2017-01-18 13.06.39.png

解決方法 for 現象その2

  • 対象の.xcworkspaceファイルを作成し直す。
  • プロジェクトを開いただけでクラッシュする現象も、これだけで改善できるのかも(ためしてない)。
rm -r myapp.xcworkspace
pod install

なぜクラッシュするかはわからず

なにやらNSArrayNSRangeExceptionが起きたらしい。
以下クラッシュ時のメッセージ(上のほうだけ)。

Process:               Xcode [6316]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               8.2.1 (11766.1)
Build Info:            IDEFrameworks-11766001000000000~5
App Item ID:           
App External ID:      
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [6316]
User ID:               501

Date/Time:             2017-01-18 13:04:34.927 +0900
OS Version:            Mac OS X 10.12.2 (16C67)
Report Version:        12
Anonymous UUID:        


Time Awake Since Boot: 12000 seconds

System Integrity Protection: enabled

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

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: 

参考

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1