【发布时间】:2017-10-13 12:03:37
【问题描述】:
我正在开发一个最初在 Xcode 8.3 和 Swift 3.2 中启动的项目,在 Xcode 9(稳定版)发布后,我使用 Xcode 9 中的内置选项将我的项目从 Swift 3.2 转换为 Swift 4.0。它也转换了像 Alamofire、SwiftyJson 等 pod。我还使用 pod update 命令更新了所有 pod。
在模拟器和 iPhone 上一切都运行良好,但是当我尝试归档项目时,归档过程失败并出现如下错误。Error Image1
Error Image2
我已经尝试了所有可能的解决方案,例如更改目标和 Pod 构建设置的 Swift 语言版本、优化级别,但是它没有用。
我也尝试过在我的 pod 文件中。
swift_32 = ['Alamofire', 'AlamofireImage', 'AssistantKit'] # if these pods are in Swift 3.2
swift4 = ['SwiftyJSON'] # if these pods are in Swift 4
post_install do |installer|
installer.pods_project.targets.each do |target|
swift_version = nil
if swift_32.include?(target.name)
swift_version = '3.2'
end
if swift4.include?(target.name)
swift_version = '4.0'
end
if swift_version
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = swift_version
end
end
end
end
构建和运行项目有效,但只有存档过程因上述错误而失败。
【问题讨论】:
-
请将您收到的错误消息添加为文本而不是屏幕截图。