gpt4 book ai didi

ios - 在 iOS (Flutter) 中使用 Firebase 和 Geolocator(或任何 Swift 插件)构建错误

转载 作者:IT老高 更新时间:2023-10-28 12:47:10 27 4
gpt4 key购买 nike

我正在尝试创建一个使用 Firebase 和 Geolocator 插件的 flutter 应用程序。

在 Android 中,一切都很好 - 一切都很好!

但是在 iOS 中,我无法构建应用程序,错误:

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

据我所知,使用 Firebase 插件 requires you NOT to use_frameworks!在播客文件中。显然,由于 Geolocator 在 iOS 部分使用 Swift 代码,it requires you TO use_frameworks!在 Podfile 中。

我知道我可以使用另一个 GPS 插件,例如 Location ,但是因为它适用于任何 Swift 代码插件,所以我的问题是:

有了 Flutter,是否可以将 Firebase 与任何 Swift 插件一起使用?

最佳答案

我不是这方面的专家,但看起来在您的 Podfile 中指定 Swift 版本可能会解决上述错误。您可以通过添加以下行来执行此操作:

config.build_settings['SWIFT_VERSION'] = '4.1'

它应该是 post_install block 的一部分,如下所示:

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.1'
end
end
end

关于ios - 在 iOS (Flutter) 中使用 Firebase 和 Geolocator(或任何 Swift 插件)构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52049070/

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