Xcode 12 crashes as soon as I open my workspace

Seconds after I open the workspace for my main project Xcode crashes and disappears.

Here is the crash info in the console app:

Code Block Process: Xcode [26370]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 12.0 (17219)
Build Info: IDEFrameworks-17219000000000000~2 (12A7209)
App Item ID: 497799835
App External ID: 837639917
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [26370]
User ID: 502
Date/Time: 2020-09-17 15:27:36.490 -0600
OS Version: Mac OS X 10.15.6 (19G2021)
Report Version: 12
Bridge OS Version: 4.6 (17P6610)
Anonymous UUID: 362A964B-A9DA-A787-4D24-905B5AF3CD6C
Time Awake Since Boot: 11000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [26370]
Application Specific Information:
ProductBuildVersion: 12A7209
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.dt.IDESwiftPackageCore 0x0000000133b03f3b PIF.Project.addTarget(id:productType:name:productName:) + 1211
1 com.apple.dt.IDESwiftPackageCore 0x0000000133ae1a20 specialized constructLibraryProductBlueprint #1 (_:type:productIdSuffix:embedResources:) in PackagePIFBuilder.build() + 688
2 com.apple.dt.IDESwiftPackageCore 0x0000000133ace3f5 PackagePIFBuilder.build() + 11285
3 com.apple.dt.IDESwiftPackageCore 0x0000000133af543f IDESwiftPackage.update(from:) + 2687
4 com.apple.dt.IDESwiftPackageCore 0x0000000133ac2ae5 IDESPMWorkspaceDelegate.dependencyPackageDidUpdate(package:) + 1461
5 com.apple.dt.SwiftPM 0x0000000133e69fc2 closure #10 in closure #1 in SPMWorkspace.processPackageGraphActionsInBackgroundIfNeeded() + 4562
6 com.apple.dt.SwiftPM 0x0000000133e78ee1 partial apply for thunk for @callee_guaranteed () -> () + 17
7 com.apple.dt.SwiftPM 0x0000000133e6d0be thunk for @escaping @callee_guaranteed () -> () + 14
8 libdispatch.dylib 0x00007fff72d5a658 _dispatch_client_callout + 8
9 libdispatch.dylib 0x00007fff72d667ab _dispatch_async_and_wait_invoke + 87
10 libdispatch.dylib 0x00007fff72d5a658 _dispatch_client_callout + 8
11 libdispatch.dylib 0x00007fff72d65cab _dispatch_main_queue_callback_4CF + 936
12 com.apple.CoreFoundation 0x00007fff38d5de81 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
13 com.apple.CoreFoundation 0x00007fff38d1dc87 __CFRunLoopRun + 2028
14 com.apple.CoreFoundation 0x00007fff38d1ce3e CFRunLoopRunSpecific + 462
15 com.apple.HIToolbox 0x00007fff37949abd RunCurrentEventLoopInMode + 292
16 com.apple.HIToolbox 0x00007fff379497d5 ReceiveNextEventCommon + 584
17 com.apple.HIToolbox 0x00007fff37949579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
18 com.apple.AppKit 0x00007fff35f8f039 _DPSNextEvent + 883
19 com.apple.AppKit 0x00007fff35f8d880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
20 com.apple.dt.DVTKit 0x0000000105bb1bd0 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 421
21 com.apple.AppKit 0x00007fff35f7f58e -[NSApplication run] + 658
22 com.apple.AppKit 0x00007fff35f51396 NSApplicationMain + 777
23 libdyld.dylib 0x00007fff72db3cc9 start + 1


Appears to be related to SwiftPM. I'm unable to use Xcode 12 for work. Reverting to Xcode 11 until this is resolved.

Same here. :(
Same here. It was related to Swift Package building.
Has anyone been able to resolve the problem? I'm unable to use Xcode 12 for my main products at this point.
facing sameProblem!!
I was finally able to solve this. I noticed that my crash was related to Swift Package Manager. Using Xcode 11, I removed the SPM dependencies one by one, then opened in Xcode 12. I was able to find the problematic dependency and rebuild it. Now the project opens in Xcode 12 with no issues.
Have the same issue!
Same issue. I found that opening a different, very basic test project first, then opening the offending project from the test project worked fine.

Xcode 12.3, macOS 11.1
I can confirm that @Tempers solution worked for me ! I opened another project and my crashing project afterwards, and that works... I guess that's a good workaround in the meantime, thanks a lot.
Seems that I have the same or similar issue using Xcode 12.4.
Although I was not experiencing this issue earlier with the same project, I have no idea what caused it.

@Tempers suggestion helped. Thx!
Same here! Apple when are you going to look at this?
Interestingly, it happens when I open Xcode while my iPhone is connected to the machine.

Even though it's not the active build target, having it connected means Xcode will freeze soon after opening any project.

So the fix was easy:
  • Disconnect iDevice

  • Open Xcode

  • Wait a bit

  • Connect device again

I am on Xcode 12.4 and also having this problem with my Flutter project.

Earlier today it was opening fine, then I quit Xcode, built a new ios version of the app through VS terminal, then tried to reopen my project in Xcode but nothing happens when I click on the .xcworkspace file, it doesn't open anything.

It does open other projects successfully, but still not the one above.

After restarting Mac and trying again, it still does not open, but gave me the message:

Xcode quit unexpectedly
Code Block Process: Xcode [2379]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 12.4 (17801)
Build Info: IDEFrameworks-17801000000000000~7 (12D4e)
App Item ID: 497799835
App External ID: 839994694
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [2379]
User ID: 501
Date/Time: 2021-04-02 18:33:36.412 +0100
OS Version: Mac OS X 10.15.7 (19H2)
Report Version: 12
Bridge OS Version: 4.6 (17P6610)
Anonymous UUID: 539C0A09-D3B8-3B12-BC86-25902B07D97B
Time Awake Since Boot: 500 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: 12D4e
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-17801/IDEKit/Workspace/IDEWorkspaceDocument.m:3270
Details: (tabController) should not be nil.
Object: <IDEWorkspaceDocument: 0x7f8d74189ed0>
Method: -commitStateToDictionary:
Thread: <NSThread: 0x7f8d6f81a630>{number = 1, name = main}
Open FDs: 38/7168
Hints:


There are a lot more lines underneath but too long to post here.

Any help on this will be appreciated, currently blocking new version going live.
For me this problem was fixed when I took out a dependency in my Package.swift file. I used vim to do it, so I'm not sure if it was just editing the file that fixed the issue or the actual dependency was the problem.

Maybe try removing some dependencies in your project, and if that doesn't solve it then editing a file in the project through a different editor and saving it might fix the issue.
Xcode 12 crashes as soon as I open my workspace
 
 
Q