我正在尝试创建一个使用 Firebase 和 Geolocator 插件的 flutter 应用程序。
- 我将使用的 Firebase 插件认证, 使用RTDB and FCM.
- The 地理定位器显然是一个非常可靠的位置感知插件。
在 Android 中,这一切都很好 - 一切都很好!
然而,在 iOS 中,我无法构建应用程序,错误:
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
据我所知,使用 Firebase 插件要求你不要使用_frameworks!在 Podfile 中。显然,由于 Geolocator 在 iOS 部分使用 Swift 代码,它需要你使用_frameworks!在 Podfile 中。
我知道我可以使用另一个 GPS 插件,例如Location,然而,由于它适用于任何 Swift 代码插件,我的问题是:
使用 Flutter,是否可以将 Firebase 与任何 Swift 插件一起使用?
我不是这方面的专家,但看起来像在你的中指定 Swift 版本Podfile
可能会解决上述错误。您可以通过添加以下行来执行此操作:
config.build_settings['SWIFT_VERSION'] = '4.1'
它应该是post_install
块,像这样:
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)