问题
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:
- Run the command 'pod repo update' (it will update your repo information)
- 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":
- Run
pod repo update
- Set the environment variable
FLUTTER_FRAMEWORK_DIR
to something that looks like/Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/
. You can do alocate Flutter.podspec
to find this directory- 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