cordova-plugin-mfp-push导致“意外的Mach-O头”错误

时间:2017-05-29 20:53:53

标签: ios cordova ibm-mobilefirst

我有一个IBM MobileFirst 8 cordova项目,我最近添加了插件“cordova-plugin-mfp-push”。

当我存档项目并尝试导出构建(ipa文件)时,我收到以下错误

Found an unexpected Mach-O header code: 0x72613c21

当我点击Show logs按钮时,我可以看到以下三个日志文件

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'>

我尝试了我在Found an unexpected Mach-O header code: 0x72613c21 in Xcode 7找到的建议,并尝试添加https://mobilefirstplatform.ibmcloud.com/blog/2016/10/17/prepare-ios-apps-for-app-store-submission/中描述的脚本,但它没有帮助解决问题。

我注意到当我删除插件cordova-plugin-mfp-push时,ipa导出工作,当我再次添加它时,它会再次失败并出现相同的错误。

这是我使用的插件列表

$ 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"

任何帮助?

1 个答案:

答案 0 :(得分:1)

在你的XCode中试试这个:

  1. 选择您的项目并转到目标 - &gt;建立阶段
  2. 展开嵌入框架
  3. 删除IBMMobileFirstPlatformFoundationPush.framework
  4. 然后转到将军
  5. 展开嵌入式二进制文件
  6. 删除IBMMobileFirstPlatformFoundationPush.framework
  7. 展开链接的框架和库
  8. 添加IBMMobileFirstPlatformFoundationPush.framework
  9. 我认为这样做可以解决您的问题。是的,不要忘记做这个link中提到的东西。