与iOS上的FlutterFire和原生GeoFire插件冲突

当我尝试将GeoFire添加到包含FlutterFire数据库插件的iOS Flutter项目时,出现错误。 这是错误的样子:

Resolving dependencies of `Podfile` [!] Unable to satisfy the following requirements: - `Firebase (~> 2.1)` required by `GeoFire (1.1.0)` Specs satisfying the `Firebase (~> 2.1)` dependency were found, but they required a higher minimum deployment target. 

我的podspec文件看起来像这样的atm:

 # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'geofire' s.version = '0.0.1' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A new flutter plugin project. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.dependency 'GeoFire', '>= 1.1' # Adding GeoFire s.ios.deployment_target = '8.0' end 

我也尝试使用git页面在我的podspec文件中添加Geofire,如下所示: GeoFire给CocoaPods

 s.dependency 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git' 

有一个(简单的)解决scheme吗?

前几天我面临同样的问题。

我想我通过执行以下步骤来修复它:

  1. 运行命令“pod repo update”(它会更新您的回购信息)
  2. 然后运行命令“pod update”(它会使用最新的回购信息更新你的豆荚)

让我知道如果这是解决您的问题:)

请尝试一下BjørnBørresen 在这里提出的方法:

自Flutter这种Cocoapods过程的摘要。 以下是我能够运行“pod repo / update”的function:

  1. 运行pod repo update
  2. 将环境variablesFLUTTER_FRAMEWORK_DIR设置为/Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/ 。 你可以做一个locate Flutter.podspecfind这个目录
  3. 从YourFlutterProject / ios运行pod update

在此之后,您应该能够再次运行您的应用程序