read

I encountered this error when uploading a binary using Xcode.

Unexpected Mach-O Header Code: 0x72613c21

This turned out to be a Firebase issue with Xcode 12.4 (it might be fixed in future Xcode/Firebase releases).

Quick Solution

A quick way to fix it is to remove the framework from the product.

  • Go to Organizer
  • Select the Archive > Show in Finder
  • Open the archive > Products > Applications > YourApp.app > Frameworks & PlugIns
  • Remove FirebaseAnalytics.framework and GoogleAppMeasurement.framework
  • Go to Organizer > Validate > Should have no more error!

If the error still persist, you can try removing any framework that you suspect, and validate.

Post-build

A permanent solution is to add a post build script. Go to the scheme > Build > Post-actions > Add new Run Script Action:

rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app/Frameworks/FirebaseAnalytics.framework"
rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app/Frameworks/GoogleAppMeasurement.framework"

Remember to select your app in Provide build settings from under the Run Script.

Extensions, Watch, etc

You will need to add these too:

rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app/PlugIns/FirebaseAnalytics.framework"
rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app/PlugIns/GoogleAppMeasurement.framework"
rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app/Watch/FirebaseAnalytics.framework"
rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app/Watch/GoogleAppMeasurement.framework"

Image

@samwize

¯\_(ツ)_/¯

Back to Home