gpt4 book ai didi

validation - 发现意外的 Mach-O header 代码 : 0x72613c21 in Xcode 7

转载 作者:行者123 更新时间:2023-12-02 23:27:59 26 4
gpt4 key购买 nike

我有一个使用 ObjC 动态框架的 Swift 项目,该框架必须与我的项目链接并嵌入到我的项目中。项目在设备上运行正常,提交到App Store时,验证时出现错误:发现意外的 Mach-O header 代码:0x72613c21

以下是验证日志:

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

如果我从项目的嵌入式框架部分中删除动态框架,那么它可以通过验证,但在设备中运行时由于缺少动态框架的图像而崩溃,知道吗?顺便说一句,动态框架禁用了位码,所以我的项目也禁用了位码,并且没有进行代码签名。

最佳答案

为每个框架检查两件事:

  1. 框架的 Mach-O 类型(在框架目标的build设置中)

Mach-O

  • 是否通过将框架放入“构建阶段”->“嵌入框架”来复制框架(或如 a.brooks hollar 提到的“复制捆绑资源”)
  • Embed frameworks

    如果框架的Mach-O类型是“静态库”,则不应将其放入嵌入框架中;如果 Mach-O 类型是“动态库”,则它应该放入嵌入框架中。

    就我而言,它是我手动添加的 SocketRocket,它具有相同框架名称的静态库目标和动态库目标。删除静态库目标并仅嵌入动态库框架后,问题消失。

    <小时/>

    注意:

    如果您无权访问源项目,您可以使用以下方法手动检查它是动态框架还是静态框架:https://stackoverflow.com/a/32591983/308315

    关于validation - 发现意外的 Mach-O header 代码 : 0x72613c21 in Xcode 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33076819/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com