gpt4 book ai didi

ios - SWIFT_VERSION 每次 pod 更新时都会出错

转载 作者:行者123 更新时间:2023-11-29 05:12:02 24 4
gpt4 key购买 nike

每次更新 Podfile 时,都必须修复此 SWIFT_VERSION 错误才能解决。

如何将pod和swift版本设置为唯一,这样每次更新pod时都不需要修复SWIFT_VERSION错误。

Error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2.  (in target 'paper-onboarding')

由于操作系统限制,X-Code 最多允许运行 swift 4.2。

Swift 5.0 将不支持,必须将其降至 4.2 版本才能兼容并在模拟器或设备上运行应用程序。

最佳答案

将此添加到 Podfile 中的 pod 定义下方。在{pod-name}中插入你想要的pod并设置你需要的版本

post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == '{pod-name}'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
end

关于ios - SWIFT_VERSION 每次 pod 更新时都会出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59591748/

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