Reputation: 341
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.
Upvotes: 28
Views: 21633
Reputation: 9983
Check that you are not embedding an static framework in the "Embedded Binaries" section in the General tab of the target.
AFAIK You can check if the framework is static if the binary icon inside the .framework is white, if the icon is black then is a dynamic framework.
Upvotes: 0
Reputation: 2617
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.
Upvotes: 11
Reputation: 2286
To add fabric or crashlytics into your project, when drag or add frameworks to project folder or to Xcode , keep 'copy items if needed' box unchecked.
Upvotes: 0
Reputation: 76
sometimes, you should look Build Phases
- Embed Pods Frameworks
. and find the shell file. eg.
and open Pods-midea-common-adddevice_Example-frameworks.sh
See if this file is a problem.
Upvotes: 1
Reputation: 186
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..
Upvotes: 2
Reputation: 2180
solved problem in my case
Build Phases -> Copy Bundle Resources for a framework or other binary that shoundn't be there
i delete TwitterKit and DigitKit binary.
Edit: When i delete this binary from Copy Bundle Resources, project can be build, archived, pass to validation and also sent to App Store. But when i run the project it's fails. So, if i delete from Copy Bundle Resources and than add to Link Binary With Library sections(we choose "Add other" and than press cmd + shift + g combination to go where your bundle or binary) it's solved.
Upvotes: 0
Reputation: 2626
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.
Upvotes: 37
Reputation: 1082
I just ran into this issue as well, and I was able to solve it...
In my case, I had created a new target by duplicating an existing one. I had changed the name from "MyApp-dev copy" to "MyApp-test", however, I forgot one thing... When you create a new target, a new .plist file is also created. I forgot to rename that file, and then link it back to my newly created target.
Once I had done that, the problem went away. I had originally been reading about targets at: http://www.raywenderlich.com/68613/create-paid-lite-version-iphone-app and going back through that page is what helped me solve the problem.
Upvotes: 0
Reputation: 41
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)
Upvotes: 4
Reputation: 973
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.
Upvotes: 35