Conflicts with FlutterFire and native GeoFire plugin on iOS

风流意气都作罢 提交于 2019-12-20 02:00:14

问题


I'm getting an error when I'm trying to add GeoFire to my iOS Flutter project which has the FlutterFire Database plugin included. This is what the error looks like:

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.

My podspec file looks like this 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

I also tried using the git page in to add Geofire in my podspec file as suggested here: GeoFire giving problems with CocoaPods

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

Is there a (simple) solution for this?


回答1:


I faced the same kind of issue few days ago.

I think I fixed it by doing the following steps:

  1. Run the command 'pod repo update' (it will update your repo information)
  2. Then run the command 'pod update' (it will update your pods using the latest repo information)

Let me know if this is solving your issue :)




回答2:


Please try the approach suggested by Bjørn Børresen here:

Since Flutter kind of abstracts away this Cocoapods process. Here's what I did to be able to run "pod repo / update":

  1. Run pod repo update
  2. Set the environment variable FLUTTER_FRAMEWORK_DIR to something that looks like /Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/. You can do a locate Flutter.podspec to find this directory
  3. From YourFlutterProject/ios run pod update

After this you should be able to run your app again



来源:https://stackoverflow.com/questions/46634757/conflicts-with-flutterfire-and-native-geofire-plugin-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!