gpt4 book ai didi

Flutter ios 构建在带有 swift_version 的 xcode 10.1 中失败

转载 作者:IT王子 更新时间:2023-10-29 06:48:57 26 4
gpt4 key购买 nike

我正在构建一个 flutter 应用程序。一切都很好。然后我认为 dart 已升级,应用程序的构建突然失败并出现此错误:

“Swift 语言版本”(SWIFT_VERSION) build设置必须设置为使用 Swift 的目标支持的值。支持的值为:3.0、4.0、4.2。可以在build设置编辑器中设置此设置。

我没有在 xcode 中看到设置,也不确定是什么导致了这个错误。还有人看过吗?

最佳答案

对于其他正在寻找解决方案的人。您需要拥有高于 10.0 的 XCode 版本才能使用 Swift 4.2。

打开您的 podfile 并进行以下更改

target 'Runner' do
use_frameworks! # <---- // 1st add this right below above line
...
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['SWIFT_VERSION'] = '4.2' # <--- // 2nd add this
end
end
end

在此之后,在终端中使用flutter runMore info

关于Flutter ios 构建在带有 swift_version 的 xcode 10.1 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53648346/

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