Found an unexpected Mach-O header code: 1918975009 in xCode 6

21,367

Solution 1

I had the same error. In my case it was caused by an universal framework that I accidentally copied into the resources of the app (which is unnecessary, since frameworks get merged directly into the main executable on iOS AFAIK).

So, select your target, click the "Build Phases" tab, and look through the "Copy Bundle Resources" list to see if you copy a library or framework that contains desktop architectures (i386 or x86_64).

Most likely, copying such a file is wrong, but if for some reason you have to, apparently it can only contain iOS compatible architectures.

Solution 2

In my case this issue ("found an unexpected mach-o header code 0x72613c21") appeared after I've installed Crashlytics, Fabric.

Somehow pods appeared to become an embedded binary. So I had to remove it, pod install once more, and the issue disappeared.

Remove pods from embedded binaries

Solution 3

Had a similar error 1918975009 with the new Swift build system in Xcode 9.3 (under Workspace Settings...) on a third-party framework that was manually added (not using Cocoapods). Maybe related to the above thread so in case it helps anyone... This only appeared after upgrading to Xcode 9.3 after it released officially yesterday. Xcode 9.2 and earlier on the new build system did not throw the warning.

:-1: <path>/Frameworks/<frameworkName>.framework/<frameworkName>: Failed to parse executable: Unknown header: 1918975009

Switching back to the old non-Swift-based build system fixes the issue. Not an optimal solution but if you're seeing a similar warning, will let you move on for now.

Solution 4

I have been experiencing the same error and wasn't able to trace it to library / framework in copy bundle resources, or an incorrect version of a library.

As a workaround, I've found that I can do an export build from the command line and it seems to work:

xcodebuild -exportArchive -exportFormat ipa \
-archivePath /path/to/app.xcarchive/ \
-exportPath /path/to/app.ipa \
-exportProvisioningProfile "Name of provisioning profile"

Here "Name of provisioning profile" is the name of the provisioning profile as it appears in Xcode (not the path to the profile)

Solution 5

Go to BUILD PHASES -> COPY BUNDLE RESOURCES, you will find there some framework. Remove from this section and add it to LINK BINARY WITH LIBRARIES. It will work..

Share:
21,367
rtvanals
Author by

rtvanals

Updated on September 03, 2020

Comments

  • rtvanals
    rtvanals almost 4 years

    What causes the error

    Found an unexpected Mach-O header code: 1918975009 in xCode 6
    

    I archived my project to send out as an ad hoc build and it builds/links/archives just fine but when I'm in the xCode organizer and select Export -> Ad Hoc,

    I get the error

    Found an unexpected Mach-O header code: 191897500.