3

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?

Bram Vanbilsen
  • 5,763
  • 12
  • 51
  • 84

2 Answers2

2

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 :)

V. Roussel
  • 74
  • 3
1

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

Rainer Wittmann
  • 7,528
  • 4
  • 20
  • 34