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?

Replies

We're also having this same problem, and the error persists for us even after removing Fabric & Crashlytics frameworks and references. We are not using CocoaPods.

Same here. I am using CocoaPods. Only started after second beta of xCode 8.

This fixed the problem for me. Thanks a bunch!!

Look in the Build Settings of the umbrella CocoaPods framework (e.g. Pods-MyApp). I found that the "Mach-O Type" was "Static Library" instead of "Dynamic Library." Changing the "Mach-O Type" to "Dynamic Library" for that framework resolved the issue for me.

I can confirm removing Fabric and Crashlytics fixes the issue.


We can deal with it until beta 3.

What about for non Cocoapod users

I had the same issue and tried many different methods. Eventually I solved the issue by clicking on the pod_YOURAPPNAME target, then going to build settings. Then under linking beside Mach-O Type change it from static to Dynamic Library.

tthat didn't work for me

Same here. Using Cocoapods master, and also version 0.38 & 0.39.

Removing Fabric and Crashlytics also worked for me. The main issue seems to be the "static" framework. Their frameworks contain static library binary instead of dylib, which seems to be no longer supported(?) in Xcode 8 since iOS 8 (embedded) dynamic frameworks are supported. Well, I'm guessing here though. They should provide us dynamic frameworks that can be embedded for iOS 8 or above. Then, this problem will go away.

Same error.


I use Chromecast framework and other two personal static library...


error: Found an unexpected Mach-O header code: 0x72613c21 -> When try "Copy Swift standard libraries"

I'm getting the same. I'm not using CocoaPods.

I'm also having the same problem, and I'm not using CocoaPods. I've tried setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO on my targets that contain Swift, but still not working.


HALP!

Thank you, this was very helpful. We have a large complicated project that uses CocoaPods, internal libraries, mixed ObjC/Swift in the main project, etc. I can confirm that what worked for us was simply removing Fabric and Crashlytics. We didn't need to do any CocoaPods-related changes, but I don't think any of our pods use Swift.


So anyway, removing Fabric/Crashlytics is a necessary step but possibly not sufficient to avoid this error.

I'm having the same problem, using CocoaPods and Fabric. 😟