xcode 5.1 crashes when old xib file is opened - xcode

I have an application that was built using Xcode 4.x a while ago. Today, I tried to update the app, but Xcode gives me the following error.
"Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool failed with exit code 255"
The problem seems to be related to MainWindow.xib because when I try to open it in Xcode, it crashes . here is the crash log:
Process: Xcode [4801]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.1 (5084)
Build Info: IDEFrameworks-5084000000000000~21
App Item ID: 497799835
App External ID: 444172641
Code Type: X86-64 (Native)
Parent Process: launchd [314]
Responsible: Xcode [4801]
User ID: 502
Date/Time: 2014-03-30 12:52:21.937 -0700
OS Version: Mac OS X 10.9.2 (13C64)
Report Version: 11
Anonymous UUID: 5F3D19A9-E9CE-6E7F-D1E6-13874A73646F
Sleep/Wake UUID: 94AB887F-E3ED-4944-92D6-E9C8274657DC
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 5B130a
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-5038/InterfaceBuilder/WidgetIntegration/SimulatedMetrics/IBUISimulatedSizeMetrics.m:33
Details: (initialTargetRuntime) should not be nil.
Object: <IBUIFixedSimulatedSizeMetrics: 0x7f890bcc9090>
Method: -initWithTargetRuntime:
Thread: <NSThread: 0x7f891bc15b90>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x0000000103275825 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
1 0x00000001020947a9 _DVTAssertionHandler (in DVTFoundation)
2 0x0000000102094a8f _DVTAssertionFailureHandler (in DVTFoundation)
3 0x000000010e0637c0 (in IDEInterfaceBuilderCocoaTouchIntegration)
4 0x000000010e064047 (in IDEInterfaceBuilderCocoaTouchIntegration)
5 0x000000010e06434a (in IDEInterfaceBuilderCocoaTouchIntegration)
6 0x000000010e0acc4e (in IDEInterfaceBuilderCocoaTouchIntegration)
7 0x000000010e0ac682 (in IDEInterfaceBuilderCocoaTouchIntegration)
8 0x000000010e0ad33c (in IDEInterfaceBuilderCocoaTouchIntegration)
9 0x000000010e04f3c8 (in IDEInterfaceBuilderCocoaTouchIntegration)
I have tried everything that is related to this question on stack overflow, but none of the remedies has solved my problem.

Exact same problem for me.
Latest Xcode
Xcode crashes when that particular Xib is viewed (MainWindow.xib).
I've researched around. Some mentioned custom fonts relating to multiple computer. Doesn't seem to solve my problem.

Contacted Apple about this and used one of my two free incident reports and asked for help. The response was to file a bug report!
I ended up re-creating the xib.

Related

XCode 10.2.1 crashes while trying to open (xcode quits unexpectedly while using the libMainThreadChecker.dylib plug-in)

When I try to open Xcode, it crashes unexpectedly and asks me to reopen. But reopening also gives me the same error. I have XCode 10.2.1 as well as XCode 11.7 installed.
Problem details and system configuration:
Process: Xcode [1607]
Path: /Applications/Xcode1.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 10.2.1 (14490.122)
Build Info: IDEFrameworks-14490122000000000~6 (10E1001)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [1607]
User ID: 501
PlugIn Path: /Applications/Xcode1.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
PlugIn Identifier: libMainThreadChecker.dylib
PlugIn Version: ??? (64490.34)
Date/Time: 2020-11-16 21:23:39.623 -0500
OS Version: macOS 11.0.1 (20B29)
Report Version: 12
Bridge OS Version: 5.0.1 (18P2561)
Anonymous UUID: 14ACF447-0D96-DDDB-DD2C-2FE0B3DB664D
Time Awake Since Boot: 4800 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fff237919b9
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Bus error: 10
Termination Reason: Namespace SIGNAL, Code 0xa
Terminating Process: exc handler [1607]
VM Regions Near 0x7fff237919b9:
__TEXT 7fff22bf8000-7fff23600000 [ 10.0M] r-x/r-x SM=COW /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
--> __TEXT 7fff23600000-7fff23800000 [ 2048K] r-x/rwx SM=COW /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
Submap 7fff23800000-7fff40000000 [456.0M] r--/rwx SM=PRV process-only VM submap
Application-Specific Information:
/Applications/Xcode1.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
ProductBuildVersion: 10E1001
Faced the same issue on Big Sur update. Git stopped working as well. Fixed it by running following command in terminal.
defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker 1
Original Answer Reference: https://developer.apple.com/forums/thread/651985?answerId=637934022#637934022
Faced the same issue after updating to Big Sur.
Found a temporary workaround:
Go to Xcode10.app/Contents/Developer/usr/lib
Rename the file libMainThreadChecker.dylib into anything else (I named it _libMainThreadChecker.dylib)
NOTE: If your project has "Main thread checker enabled" it may crash somewhere, so it's better to disable it.
This is a known issues
Currently there is one workaround for this.
You've to run the following command in the Terminal app to avoid crashes when starting Xcode:
defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker 1
Now deactivate "Main Thread Checker" in your Xcode project: Edit
Scheme -> Run/Test -> Diagnostics -> Uncheck Main Thread Checker.

Xcode 10.3 does not work on MacOS Big Sur 11.0.1 (non beta)

I have tried to format my MacOS, redownload Xcode 10.3. It just doesnt work.
Logs:
Process: Xcode [22467]
Path: /Users/USER/Downloads/Xcode_10.3.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 10.3 (14492.2)
Build Info: IDEFrameworks-14492002000000000~2 (10G8)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [22467]
User ID: 501
PlugIn Path: /Users/USER/Downloads/Xcode_10.3.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
PlugIn Identifier: libMainThreadChecker.dylib
PlugIn Version: ??? (64492.1)
Date/Time: 2020-11-13 16:52:33.909 +0800
OS Version: macOS 11.0.1 (20B29)
Report Version: 12
Bridge OS Version: 3.0 (14Y908)
Anonymous UUID: 46BBB97A-6E02-4B36-B8CE-640575A752F0
Time Awake Since Boot: 4500 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fff2379c9b9
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Bus error: 10
Termination Reason: Namespace SIGNAL, Code 0xa
Terminating Process: exc handler [22467]
VM Regions Near 0x7fff2379c9b9:
__TEXT 7fff22c03000-7fff23600000 [ 10.0M] r-x/r-x SM=COW /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
--> __TEXT 7fff23600000-7fff23800000 [ 2048K] r-x/rwx SM=PRV /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
Submap 7fff23800000-7fff40000000 [456.0M] r--/rwx SM=PRV process-only VM submap
Application Specific Information:
/Users/junjie/Downloads/Xcode_10.3.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
ProductBuildVersion: 10G8
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libMainThreadChecker.dylib 0x00000001176b8069 swizzleImplementationFast + 115
1 libMainThreadChecker.dylib 0x00000001176b7ef0 addSwizzler + 165
2 libMainThreadChecker.dylib 0x00000001176b7aec __library_initializer + 2937
3 dyld 0x0000000117b21df5 ImageLoaderMachO::doImageInit(ImageLoader::LinkContext const&) + 321
4 dyld 0x0000000117b2246d ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) +
Any suggestion or idea how to resolve this?
Ok I managed to get it up and running by deleting ~/Downloads/Xcode_10.3.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
It compiles my project.
To be safe, I have copied this same dylib file from latest Xcode 12.2 and put into that folder. It is still working so far.
I had the same problem, I initially solved it using defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker 1. After this, Xcode 10 seemed to work on macOS 11, and everything would build from within Xcode.
I then had the weirdest issue - when compiling from the command line using xcodebuild, the whole machine would grind to a halt and eventually hang, requiring a "hold down the power button" restart. The problem turned out to be that ibtool (used for compiling IB files) was not honouring DVTDisableMainThreadChecker, and was still crashing. This was somehow causing the machine to get into a state where it stopped responding.
The solution was to copy libMainThreadChecker.dylib from Xcode 12 into the Xcode 10 package. After that the problem went away.

Xcode will no longer open project

Xcode won't open a project workspace. It immediately quits and throws this error report. Everything was fine on my last commit. I'm not sure how go about finding the issue. It says Assertion failed: _numberOfTabsForLayout > 1 I don't have any type of tab bar in this project but I did close the project with multiple tabs open in the workspace.
Process: Xcode [8382]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.4 (7720)
Build Info: IDEFrameworks-7720000000000000~8
App Item ID: 497799835
App External ID: 812725084
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [8382]
User ID: 501
Date/Time: 2015-10-18 20:06:46.433 -0400
OS Version: Mac OS X 10.11 (15A284)
Report Version: 11
Anonymous UUID: 2C67D893-30CC-08A5-E12A-E03DD1BAEFBD
Sleep/Wake UUID: 844DC3EB-F2C2-496A-BEEB-C72AE1AFE3F9
Time Awake Since Boot: 48000 seconds
Time Since Wake: 5800 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: 6E35b
ASSERTION FAILURE in /SourceCache/DVTFrameworks/DVTFrameworks-7714/DVTKit/Tabs/DVTScrollableTabBarView.m:1270
Details: Assertion failed: _numberOfTabsForLayout > 1
Object: <DVTScrollableTabBarView: 0x7fd3dfa81230>
Method: -_calculateStackingRegions
Thread: <NSThread: 0x7fd3da5207f0>{number = 1, name = main}
Hints: None
Backtrace:
0 0x0000000103b8cfda -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
Update: I figured out how to get it to open but not how to resolve the problem. If I disconnect my second monitor it will open and work just fine. I can reconnect the monitor once it's open and everything is fine. But each time I need to reopen the project I have to pull the HDMI cable out.

Log does not come out

I am trying to make a log appear using this code. However I cannot see the log. xcode just crashes.
-(void) deleteMyFiles:(NSString*)filePath {
NSError *error;
if([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
[[NSFileManager defaultManager] removeItemAtPath:filePath error:&error];
} else {
NSLog(#"not Exists");
}
}
Crash Report of xcode
Process: Xcode [3625]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.0 (3332.25)
Build Info: IDEApplication-3332025000000000~2
App Item ID: 497799835
App External ID: 38302662
Code Type: X86-64 (Native)
Parent Process: launchd [145]
User ID: 501
Date/Time: 2013-11-17 12:19:38.805 +0900
OS Version: Mac OS X 10.8.5 (12F37)
Report Version: 10
Interval Since Last Report: 58305 sec
Crashes Since Last Report: 6
Per-App Interval Since Last Report: 62699 sec
Per-App Crashes Since Last Report: 6
Anonymous UUID: 2C13D4CB-E939-611C-EA15-933EC101D4E5
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 5A1413
ASSERTION FAILURE in /SourceCache/IDEKit/IDEKit-3591/Framework/Classes/Editor/IDEEditorDocument.m:702
Details: Autosaving when there is a different document instance registered w/ IDEDocumentController { self:0x7fda77aa62a0: 0 0x00000001099e5f48 -[DVTDocumentLocation(IDESourceControlDocumentLocationAdditions) exportDocumentUsingTemplateDocument:completionBlock:primaryBehavior:] (in IDEKit)
1 0x00000001097ba663 -[IDESourceControlComparisonEditorDataSource documentForPrimaryDocumentLocation:completionBlock:] (in IDEKit)
I think the main reason is that I am using the LLDB debugger but I want to change to GDB but there is no option except LLDB in the edit scheme area.
GDB is not supported in Xcode 5. Quote from release notes:
Important: Xcode 5 does not support use of the LLVM-GCC compiler and the GDB debugger. Existing projects configured to use LLVM-GCC and GDB will be reconfigured to use the LLVM compiler and LLDB debugger when opened by Xcode 5. Please file a bug using bugreporter.apple.com for any issues that prevent you from moving to Xcode 5 for this reason.
Maybe discussion in this thread # discussion.apple.com helps to fix that crashing problem.

Xcode crash when refreshing provisioning profiles

I cant seem to refresh my provisioning profiles in Xcode without crashes. Every time I press the refresh button in organizer it crashes and I retrieve this line from the error log:
UNCAUGHT EXCEPTION (NSInvalidArgumentException): *** setObjectForKey: object cannot be nil (key: teamId)
So I checked my teamId but dont find anything unusual. Anybody have any ideas what causing my problem? This uses to work for me every time I refreshed my profiles. Even did that this morning for like 10 times.
EDIT:
Heres the crash report if needed:
Process: Xcode [1136]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 4.6.1 (2067)
Build Info: IDEApplication-2067000000000000~2
App Item ID: 497799835
App External ID: 14581035
Code Type: X86-64 (Native)
Parent Process: launchd [272]
User ID: 501
Date/Time: 2013-03-15 15:21:43.906 +0100
OS Version: Mac OS X 10.8.3 (12D78)
Report Version: 10
Interval Since Last Report: 14773 sec
Crashes Since Last Report: 9
Per-App Interval Since Last Report: 14523 sec
Per-App Crashes Since Last Report: 7
Anonymous UUID: E5C08B95-3313-ABC3-6BB7-F22E76735A98
Crashed Thread: 2 Dispatch queue: NSManagedObjectContext Queue
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 4H512
UNCAUGHT EXCEPTION (NSInvalidArgumentException): *** setObjectForKey: object cannot be nil (key: teamId)
UserInfo: (null)
Hints: None
Backtrace:
0 0x00007fff92639aee __exceptionPreprocess (in CoreFoundation)
1 0x00007fff98d703f0 objc_exception_throw (in libobjc.A.dylib)
2 0x00007fff926c85b7 -[__NSDictionaryM setObject:forKey:] (in CoreFoundation)
3 0x0000000107d42d88 +[DTDKTeamBasedService _createRequestDictionaryForTeam:andPlatform:] (in DTDeviceKit)
4 0x0000000107d45315 +[DTDKDownloadProvisioningProfileService serviceForTeam:andPlatform:andProfileID:withError:] (in DTDeviceKit)
5 0x0000000107d6e1c0 +[DTDKDownloadProvisioningProfileService serviceForProvisioningProfileRecord:withError:] (in DTDeviceKit)
6 0x0000000107d73728 __72+[DTDKPortalDatabase _refreshFromProvisioningProfileListServices:error:]_block_invoke (in DTDeviceKit)
7 0x00007fff9429d4dc developerSubmittedBlockToNSManagedObjectContextPerform (in CoreData)
8 0x00007fff9429d40a -[NSManagedObjectContext performBlockAndWait:] (in CoreData)
9 0x0000000107d73246 +[DTDKPortalDatabase _refreshFromProvisioningProfileListServices:error:] (in DTDeviceKit)
10 0x0000000107d75816 __56+[DTDKPortalDatabase refresh:parentWindow:withCallback:]_block_invoke_5 (in DTDeviceKit)
11 0x00007fff942cd7cf developerSubmittedBlockToNSManagedObjectContextPerform_privateasync (in CoreData)
12 0x00007fff90dd20b6 _dispatch_client_callout (in libdispatch.dylib)
13 0x00007fff90dd347f _dispatch_queue_drain (in libdispatch.dylib)
14 0x00007fff90dd32f1 _dispatch_queue_invoke (in libdispatch.dylib)
15 0x00007fff90dd31c3 _dispatch_worker_thread2 (in libdispatch.dylib)
16 0x00007fff964d4d0b _pthread_wqthread (in libsystem_c.dylib)
17 0x00007fff964bf1d1 start_wqthread (in libsystem_c.dylib)
objc[1136]: garbage collection is ON
abort() called
.....
[The report itself is very large and contains much more than this]
Remove this file:
~/Library/Developer/Xcode/connect1.apple.com 4.6.1.db
before running Xcode 4.6.1.
Here is apple's official workaround:
Run this command in terminal:
mkdir ~/Library/Developer/Xcode/OldPortalDBs; mv ~/Library/Developer/Xcode/connect1.apple.com* ~/Library/Developer/Xcode/OldPortalDBs
Worked like a charm for me.
Someone had this problem at NSCoder Night this week. Cleared by removing:
~/Library/Caches/com.apple.dt.Xcode.
sqlite3 ~/Library/Caches/com.apple.dt.Xcode/PortalData/connect1.apple.com
Shows that file to be an SQLite database, with references to certificates, teams, and profiles. I suspect (but haven't tried) that removing the PortalData folder would be sufficient to clear the error.
Removing this file worked for me.
~/Library/Developer/Xcode/connect1.apple.com 4.6.1.db
Thanks!

Resources