Found an unexpected Mach-O header code: 0x72613c21 in Xcode 7

Check two things for every framework:

  1. The Mach-O type of the framework (in Build Settings of the framework target)

Mach-O

  1. Whether you copy the framework by putting it in Build Phases -> Embed Frameworks (or Copy Bundle Resources as mentioned by a. brooks hollar)

Embed frameworks

If the Mach-O type of the framework is “static library”, it should not be put in embed frameworks; if the Mach-O type is “dynamic library”, it should be put in embed frameworks.

In my case it was SocketRocket I added manually which has both a static library target and a dynamic library target with the same framework name. After deleting the static library target and only embed the dynamic library framework, the problem disappears.


Note:

If you don’t have access to the source project, you can manually check if it’s a dynamic or static framework using this approach: https://stackoverflow.com/a/32591983/308315

Leave a Comment