代码之家  ›  专栏  ›  技术社区  ›  Feu

使用iOS(flutter)中的firebase和geoclocator(或任何swift插件)生成错误

  •  2
  • Feu  · 技术社区  · 6 年前

    我正在尝试创建一个使用FireBase和地理定位插件的flutter应用程序。

    在安卓系统中,一切都很好-一切都很好!

    但是在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插件 requires you NOT to use_frameworks! 在podfile中。显然,由于地理定位器在iOS部分使用了Swift代码, it requires you TO use_frameworks! 在PODFILE文件中。

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

    使用flutter,是否可以将firebase与任何swift插件一起使用?

    1 回复  |  直到 6 年前
        1
  •  2
  •   Maurits van Beusekom    6 年前

    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