1
votes

I have an IBM MobileFirst 8 cordova project, and I recently added the plugin "cordova-plugin-mfp-push".

When I archive the project and try to export the build (ipa file), I am getting the following error

Found an unexpected Mach-O header code: 0x72613c21

When I click on Show logs button, I can see the following three log files

IDEDistribution.critical.log

2017-05-29 20:30:43 +0000 [MT] Failed to generate distribution items with error: Error Domain=DVTMachOErrorDomain Code=0 "Found an unexpected Mach-O header code: 0x72613c21" UserInfo={NSLocalizedDescription=Found an unexpected Mach-O header code: 0x72613c21, NSLocalizedRecoverySuggestion=}
2017-05-29 20:30:43 +0000 [MT] Presenting: Error Domain=DVTMachOErrorDomain Code=0 "Found an unexpected Mach-O header code: 0x72613c21" UserInfo={NSLocalizedDescription=Found an unexpected Mach-O header code: 0x72613c21, NSLocalizedRecoverySuggestion=}

IDEDistribution.standard.log

2017-05-29 20:30:39 +0000 [MT] Beginning distribution assistant for archive: my_custom_app, task: Export
2017-05-29 20:30:41 +0000 [MT] Proceeding to distribution step IDEDistributionSigningAssetsStepViewController, context: <IDEDistributionContext: 0x7fafaadba400; archive(resolved)='<IDEArchive: 0x7fafa97005d0>', distributionTask(resolved)='2', distributionMethod(resolved)='<IDEDistributionMethodAdHoc: 0x7fafc584f070>', teamID(resolved)='(null)'>
    Chain (2, self inclusive):
    <IDEDistributionContext: 0x7fafaadba400; archive = '(null)', distributionMethod='(null)', teamID='(null)'>
    <IDEDistributionContext: 0x7fafa96425c0; archive = '<IDEArchive: 0x7fafa97005d0>', distributionMethod='<IDEDistributionMethodAdHoc: 0x7fafc584f070>', teamID='(null)'>
</IDEDistributionContext: 0x7fafaadba400>
2017-05-29 20:30:43 +0000 [MT] [OPTIONAL] Didn't find archived user entitlements for <DVTFilePath:0x7fafaab22d80:'/Users/user1/Library/Developer/Xcode/Archives/2017-05-29/my_custom_app 5-29-17, 21.29.xcarchive/Products/Applications/my_custom_app.app/Frameworks/IBMMobileFirstPlatformFoundationPush.framework'>: Error Domain=NSCocoaErrorDomain Code=4 "Item at "/Users/user1/Library/Developer/Xcode/Archives/2017-05-29/my_custom_app 5-29-17, 21.29.xcarchive/Products/Applications/my_custom_app.app/Frameworks/IBMMobileFirstPlatformFoundationPush.framework" did not contain a "archived-expanded-entitlements.xcent" resource." UserInfo={NSLocalizedDescription=Item at "/Users/user1/Library/Developer/Xcode/Archives/2017-05-29/my_custom_app 5-29-17, 21.29.xcarchive/Products/Applications/my_custom_app.app/Frameworks/IBMMobileFirstPlatformFoundationPush.framework" did not contain a "archived-expanded-entitlements.xcent" resource.}
2017-05-29 20:36:45 +0000 [MT] Canceled distribution assistant

IDEDistribution.verbose.log

2017-05-29 20:30:39 +0000 [MT] Available distribution methods: (
    "<IDEDistributionMethodiOSAppStoreExport: 0x7fafc5839310>",
    "<IDEDistributionMethodAdHoc: 0x7fafc584f070>",
    "<IDEDistributionMethodEnterprise: 0x7fafc582a930>",
    "<IDEDistributionMethodDevelopmentSigned: 0x7fafc39cdee0>"
)
2017-05-29 20:30:43 +0000 [MT] IDEDistributionItem init <DVTFilePath:0x7fafaab22d80:'/Users/user1/Library/Developer/Xcode/Archives/2017-05-29/my_custom_app 5-29-17, 21.29.xcarchive/Products/Applications/my_custom_app.app/Frameworks/IBMMobileFirstPlatformFoundationPush.framework'>

I tried the suggestions that I found at Found an unexpected Mach-O header code: 0x72613c21 in Xcode 7, and I tried adding the script described at https://mobilefirstplatform.ibmcloud.com/blog/2016/10/17/prepare-ios-apps-for-app-store-submission/ but it haven't helped fixing the issue.

I noticed that when I remove the plugin cordova-plugin-mfp-push, the ipa export works, and when I add it again it fails again with the same error.

Here is the plugins list I use

$ cordova plugin ls
cordova-plugin-android-permissions 0.10.0 "Permissions"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-custom-calendar 0.0.1 "Calendar"
cordova-plugin-custom-uuid-creator 0.0.1 "UUID Creator"
cordova-plugin-device 1.1.5 "Device"
cordova-plugin-dialogs 1.3.2 "Notification"
cordova-plugin-file 4.3.2 "File"
cordova-plugin-file-transfer 1.6.2 "File Transfer"
cordova-plugin-geolocation 2.4.2 "Geolocation"
cordova-plugin-globalization 1.0.6 "Globalization"
cordova-plugin-mfp 8.0.2017033009 "IBM MobileFirst Platform Foundation"
cordova-plugin-mfp-push 8.0.2017012410 "IBM MobileFirst Platform Foundation - Push Notifications"
cordova-plugin-okhttp 2.0.0 "OkHttp"
cordova-plugin-splashscreen 4.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3-dev "Whitelist"

Any help?

1
You are trying to build an app with which version of xcode ?Vittal Pai
I am using Xcode 8.2.1AmineG
Did you try the below solution?Prerak Tiwari
@PrerakTiwari thanks, it worked fineWiPhone

1 Answers

1
votes

Try this out in your XCode:

  1. Select your project and go to Targets --> Build Phases
  2. Expand Embed Frameworks
  3. Remove IBMMobileFirstPlatformFoundationPush.framework
  4. Then go to General
  5. Expand Embedded Binaries
  6. Remove IBMMobileFirstPlatformFoundationPush.framework
  7. Expand Linked Frameworks and Libraries
  8. Add IBMMobileFirstPlatformFoundationPush.framework

I think doing this should resolve your issue. And yes don't forget to do the stuff mentioned in this link.