【问题标题】:AWS with Xcode 8 beta: Found an unexpected Mach-O header code: 0x72613c21带有 Xcode 8 beta 的 AWS:发现意外的 Mach-O 标头代码:0x72613c21
【发布时间】:2016-07-09 18:59:04
【问题描述】:

我刚刚尝试使用新的 Xcode 8 测试版构建我之前在 Xcode 7 下开发的应用程序,并在使用最新的 AWS SKD (2.4.5) 时收到以下错误: Found an unexpected Mach-O header code: 0x72613c21

Delete all Frameworks from Embedded Frameworks 会消除错误,但会产生一个新错误: bash: /Users/*****/Library/Developer/Xcode/DerivedData/MyApp-gmsydrrvmebbiuarunefhhwwkuty/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/AWSCore.framework/strip-frameworks.sh: No such file or directory

有没有人在 Xcode 8 中遇到过类似的错误并且可能已经修复了?

【问题讨论】:

  • 你确认这个文件存在“strip-frameworks.sh”
  • 它不存在。如果我手动把它放在那里,我会在编译时再次遇到第一个错误。
  • 所以该文件和版本存在问题。
  • 所以我得等亚马逊发布新版本(因为旧版本根本无法与新 Xcode 一起使用)?!
  • 你试过我下面的答案了吗?

标签: ios xcode swift amazon-web-services sdk


【解决方案1】:

如果您使用的是 Swift pod,请将其添加到您的 Podfile 中,然后检查:

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  

【讨论】:

    【解决方案2】:

    我在构建或运行时从未遇到过错误,但是当我尝试验证我的应用以进行提交时,我得到了:

    2016-09-10 01:35:11 +0000 [MT] 无法生成分发项目 错误:错误域=DVTachOErrorDomain 代码=0“找到一个 意外的 Mach-O 标头代码:0x72613c21" UserInfo={NSLocalizedDescription=发现意外的 Mach-O 标头 代码:0x72613c21,NSLocalizedRecoverySuggestion=} 2016-09-10 01:35:11 +0000 [MT] 呈现:错误域 = DVTMachOErrorDomain 代码 = 0“发现意外的 Mach-O 标头代码:0x72613c21” UserInfo={NSLocalizedDescription=发现意外的 Mach-O 标头 代码:0x72613c21,NSLocalizedRecoverySuggestion=}

    有很多用户受到此问题的困扰: https://github.com/CocoaPods/CocoaPods/issues/5598 https://forums.developer.apple.com/thread/50969

    如果你使用 cocoapods,目前有 2 件事你应该尝试:

    1:按照error2007s 的建议,在您的 Podfile 中禁用 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES。

    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
    

    之后记得运行pod install

    2:将您的 Pods-[YOUR_APP_NAME] Mach-O 类型从静态库更改为动态库。

    • 转到您的 Pods 项目并在 Targets 下找到您的 Pods-[YOUR_APP_NAME]
    • 选择Build Settings 并按mach 过滤
    • 您现在应该会看到 Mach-O Type 设置为静态库
    • 将其更改为动态库
    • 存档您的项目并尝试再次验证

    请注意,每当您再次运行 pod install 时,它都会将其恢复为静态库。

    【讨论】:

      猜你喜欢
      • 2020-02-18
      • 1970-01-01
      • 1970-01-01
      • 2021-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-20
      • 1970-01-01
      相关资源
      最近更新 更多