提交到 App Store 时如何修复 'Found an unexpected Mach-O header code: 0x72613c21'

How to fix 'Found an unexpected Mach-O header code: 0x72613c21' when submitting to App Store

我无法将项目的存档版本上传到 App Store Connect,因为我收到错误 'Found an unexpected Mach-O header code: 0x72613c21'。

我已经尝试过其他建议,比如检查任何框架的 'Copy Bundle Resources' 构建阶段,但它很干净。我还看到一个 Podfile 扩展说它会修复它,但我的依赖管理器是迦太基,所以我无法使用它。

2019-08-13 22:21:51 +0000  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=}

原来我的 input.xcfilelistoutput.xcfilelist 中有一个静态框架。我刚刚将其删除,一切正常!

就我而言,我从 Carthage input.xcfilelist 和 output.xcfilelist 中删除了 Fabric、Crashlytics、AppCenter 框架,因为这些框架是静态的。

注意:我从日志文件中找到了详细信息 "IDEDistribution.verbose.log"。

如果您正在使用 pods,那么只需做两件事。

清理项目 Pods 取消集成 -> pod install again 这对我有用。 快乐编码