Runtime error "file does not start with MH_MAGIC[_64]"

Since upgrading to Xcode 14, an xc-framework that is built with carthage does not let the project run anymore (building works without error).

The error is:

dyld[50600]: Library not loaded: @rpath/Bolts.framework/Bolts
  Referenced from: <...>
    /.../Build/Products/Debug-iphonesimulator/ParseFacebookUtilsV4.framework/ParseFacebookUtilsV4
  Reason: tried:
    '/.../Build/Products/Debug-iphonesimulator/Bolts.framework/Bolts' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'arm64')),
    '/.../Build/Products/Debug-iphonesimulator/PackageFrameworks/Bolts.framework/Bolts' (errno=2),

The embedded Bolts.xcframework contains both architectures:

  • ios-arm64
  • ios-arm64_x86_64-simulator

So the respective architecture should be available to Xcode.

It seems as if the ParseFacebookUtilsV4.framework requires Bolts in a specific way, so I tried to add a build phase script that copies the respective arch from the ParseFacebookUtilsV4.xcframework to ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app, from ios-arm64 if it builds for a device install, from ios-arm64_x86_64-simulator if it builds for the simulator. But that didn't help.

What change has there been in Xcode 14 (compared to Xcode 13) that suddenly causes this?

  • Sorry there is a typo, it should read:

    I tried to add a build phase script that copies the respective arch from the Bolts.xcframework
Add a Comment