Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 339 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Found an unexpected Mach-O header code: 0x72613c21 in Xcode 7

#1
I have a Swift project that uses a ObjC dynamic framework, the framework had to be linked with and embedded into my project. The project runs OK in devices, when submitted to App Store, the error occurred during validation:
`Found an unexpected Mach-O header code: 0x72613c21`

Below are the validation logs:

2015-10-12 02:32:33 +0000 [MT] Beginning distribution assistant for archive: MusicFans, task: Validate
2015-10-12 02:32:33 +0000 [MT] Automatically selecting the only availaable distribution method <IDEDistributionMethodiOSAppStoreValidation: 0x7f851c1d96c0>
2015-10-12 02:32:34 +0000 [MT] [OPTIONAL] Didn't find archived user entitlements for <DVTFilePath:0x7f851b42db10:'/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/Frameworks/libswiftDispatch.dylib'>: Error Domain=NSCocoaErrorDomain Code=4 "Item at "/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/Frameworks/libswiftDispatch.dylib" did not contain a "archived-expanded-entitlements.xcent" resource." UserInfo={NSLocalizedDescription=Item at "/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/Frameworks/libswiftDispatch.dylib" did not contain a "archived-expanded-entitlements.xcent" resource.}
2015-10-12 02:32:34 +0000 [MT] [OPTIONAL] Didn't find archived user entitlements for <DVTFilePath:0x7f8529a08050:'/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/wavpack.framework'>: Error Domain=NSCocoaErrorDomain Code=4 "Item at "/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/wavpack.framework" did not contain a "archived-expanded-entitlements.xcent" resource." UserInfo={NSLocalizedDescription=Item at "/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/wavpack.framework" did not contain a "archived-expanded-entitlements.xcent" resource.}
2015-10-12 02:32:34 +0000 [MT] [OPTIONAL] Didn't find archived user entitlements for <DVTFilePath:0x7f850da13de0:'/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/FLAC.framework'>: Error Domain=NSCocoaErrorDomain Code=4 "Item at "/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/FLAC.framework" did not contain a "archived-expanded-entitlements.xcent" resource." UserInfo={NSLocalizedDescription=Item at "/Users/panzhansheng/Library/Developer/Xcode/Archives/2015-10-11/MusicFans 11-10-15 上午8.29.xcarchive/Products/Applications/MusicFans.app/FLAC.framework" did not contain a "archived-expanded-entitlements.xcent" resource.}
2015-10-12 02:33:07 +0000 [MT] Canceled distribution assistant

If I remove the dynamic framework from the project’s Embedded frameworks section, then it can pass the validation, but crashes when run in devices due to the missing image of my dynamic framework, any idea?
BTW, dynamic framework has bitcode disabled, so my project also disables bitcode, and is not codesigned.


Reply

#2
Double check Build Phases -> Copy Bundle Resources for a framework or other binary that shoundn't be there.

In my case, it was a 3rd party library (Parse) that I had added.
Reply

#3
In my case it was caused by change of Developer certificate/team.

I start project with personal Dev Apple ID and by the time I changed it to my work ID.
When we try to export .xcarchive then "Match-O header" fail did appear.
Nothing described here or at other sites don't change anything.

When I change Team back to my personal ID, error logs shows missing .xcent files for only few frameworks now (most recently added). So I start whole new project, paste all the sources and files, then run cocoapod and everything works as expect.
Reply

#4
**Edit**: This looks to be fixed in Xcode 8 Beta 3.

I'm currently experiencing this issue with Xcode 8 Beta 2 and Swift 3 with pure-swift Pods (which seems to be causing the issue).

Adding the following to my Podfile has fixed the problem.

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
end
end
end

Credit goes to [this comment](

[To see links please register here]

) by YuAo on GitHub.
Reply

#5
I had same issue in Xcode 8 beta 3. I fixed it removing Fabric and Crashlytics from Linked frameworks (Project => Target => General page) ([source][1])



[1]:

[To see links please register here]

Reply

#6
I had a same issue. I did a couple of things and my issue went away. I believe My issue was related to Cocoapods version but you can try couple of things here.

First clean DerivedData by:


> 1.Turn off Xcode
>
> 2.Go to ./Users/YourFile/Library/Developer/Xcode/DerivedData
>
> 3.Delete everything from this folder
>
> 4.Run Xcode
>
> 5.Build&Clean

Second for some reason, with latest cocoa pods version 0.39, I was getting following warning when I ran `pod install`
>
>[!] The `MY_TARTGET` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation

I've downgraded cocoapods by removing all installed cocoapods:

> sudo gem uninstall cocoapods

then install older version:

> sudo gem install cocoapods -v 0.38.1

This removed the warning and I was able to remove the error, "unexpected Mach-O header code: 0x72613c21"
Reply

#7
I ran into this error with a FacebookSDK framework. I removed it from the Embed frameworks list in Build Phases and it solved the issue. Inspect the log and find the framework causing the error as mentioned by others.
Reply

#8
I had this problem with a manually-added PFFacebookUtils framework in a Swift 2.3 non-CocoaPods project. I fixed it by removing said framework from the embedded frameworks section of the "General" page of the build target and linked it in Build Phases -> Link Binary With Libraries
Reply

#9
I encountered this issue in a very simple Framework project. I only had one target in my project for the framework and it was building fine. I wanted to add some unit tests, so I added two new targets: an iOS Unit Testing Bundle target, and a Single View Application target (to act as a host app for the tests). However, both new targets were throwing this error.

I discovered that the problem was caused by the Mach-O Type build setting on the new targets being set to Static Library. Apparently the new targets were inheriting the Mach-O type from the parent Project. When I set the Mach-O Type to the correct settings ("Bundle" for unit tests and "Executable" for the host app) it all worked! I also had to clean build, delete derived data and reset the simulator to get the new settings to take.
Reply

#10
In my case, I have a framework manually dragged into my project, and it is listed in `General`->`Embedded Binaries`, which cause error `Found an unexpected Mach-O header code: 0x72613c21`. After i moved it from `Embedded Binaries` to `Linked Frameworks and Libraries`, problem solved.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through