Found an unexpected Mach-O header code: 0x72613c21

After updating to Xcode beta 2 and fixing the new build errors (mostly Foundation and UIKit class functions becoming properties) I'm getting a build error on my main app target:

CopySwiftLibs /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/Engagement.app
    cd /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10
    export CODESIGN_ALLOCATE=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export SDKROOT=/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk
    builtin-swiftStdLibTool --copy --verbose --sign - --scan-executable /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/Engagement.app/Engagement --scan-folder /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/Engagement.app/Frameworks --scan-folder /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/Engagement.app/PlugIns --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/FLAnimatedImage.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/NYTPhotoViewer.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/TNKRefreshControl.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/TNKImagePickerController.framework --scan-folder /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/RealmUI.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/AFNetworking.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/OnePasswordExtension.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/KVOController.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/PhoneNumberKit.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/FMDB.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/TNKFoundation.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/UTIKit.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/CRToast.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/SlackTextViewController.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/FormatterKit.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Crashlytics.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/CacheKit.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/Locksmith.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Fabric.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/JGProgressHUD.framework --scan-folder /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/RealmCore.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/Analytics.framework --scan-folder /Users/davbeck/Documents/Development/ACS/Realm/RealmEngagement.iOS10/Carthage/Build/iOS/SocketIOClientSwift.framework --platform iphonesimulator --destination /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/Engagement.app/Frameworks --strip-bitcode --resource-destination /Users/davbeck/Library/Developer/Xcode/DerivedData/Engagement-evkgwhedhxhvxvbtbsxvdzuxhben/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/Engagement.app --resource-library libswiftRemoteMirror.dylib
error: Found an unexpected Mach-O header code: 0x72613c21

Oddly it looks to be related to the swift libraries?

I see no Fabric/Crashlytics updates here. Latest version (3.7.2) still causes the error.

@diego, when I tried in an empty test project, the project would not compile with only the older versions as dependencies. However, updating to 3.7.2 for Crashlytics and 1.6.7 for Fabric did compile. What other dependencies do you have? In my main project, I had two other dependencies which had not been updated in awhile. Through trial-and-error I was able to identify which two were the culprits. I needed to update Fabric/Crashlytics, and two other dependencies for the overall project to compile.


If you are working with pre-compiled dependencies, it appeared that some of the older dependencies may have had the wrong value set for the "Mach-O Type" configuration in their build settings.

I have just another dependency which is Alamofire and it is build from their new swift2.3 branch. Anyway, removing Fabric/Crashlytics solves the problem. Just tried adding them again, and the error appears :/

Interesting... are you pulling them in via Cocoapods, or using the frameworks from the Fabric installer?

From the Fabric own installer.

This would be an interesting test:


- Take the Fabric.framework and Crashlytics.framework that you have from the installer, and try linking them by hand with a sample project with no other dependencies. Based on what you're seeing, I would expect that it would not be able to build with Xcode 8 and that you would see the same Mach-O error.


Then, try installing Fabric/Crashlytics in your project via Cocoapods. I was installing them via pods when they worked for me (and the older versions that I had were from the installer). I had assumed that the difference was just the old ones vs the new ones, but it's possible that something about the way crashlytics links them ends up being different from what the installer does.

This is finally fixed in Beta 4! 🙂

I resolved this problem by removing CouchbaseLite.framework and CouchbaseLiteListener.framework from the Embedded Binaries section on my target. I guess I didn't need to embed it, but rather simply link to the frameworks. Tough to find the source of the problem though. I tried all of the Cocopods suggestions to no avail. But I saw someone else mention removing Realm.framework from their Embedded Binaries and thought maybe I should try that with Couchbase. It worked!

Found an unexpected Mach-O header code: 0x72613c21
 
 
Q