Cocoapods error after installing “firebase_firestore” Flutter plugin [duplicate]

北城余情 提交于 2019-12-11 05:05:59

问题


I've got my app working with the Firebase RTDB but want to experiment with Firestore so I have followed the instructions and installed the 'firebase_firestore' plugin.

When I run my app now I get the following error:

 Resolving dependencies of `Podfile`
    [!] Unable to satisfy the following requirements:

    - `Firebase/Firestore` required by `firebase_firestore (0.0.1)`

    Specs satisfying the `Firebase/Firestore` dependency were found, but they required a higher minimum deployment target.

I've tried specifying platform :ios, '9.0' and also 10.0in my Podfile but that didn't make any difference. All other pods install fine.

Here's the entire Cocoapods run log: https://pastebin.com/raw/SBz8Bqgf

My Podfile looks like this (standard Flutter Podfile):

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
  abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end

target 'Runner' do
  # Pods for Runner

  # Flutter Pods
  pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']

  if File.exists? '../.flutter-plugins'
    flutter_root = File.expand_path('..')
    File.foreach('../.flutter-plugins') { |line|
      plugin = line.split(pattern='=')
      if plugin.length == 2
        name = plugin[0].strip()
        path = plugin[1].strip()
        resolved_path = File.expand_path("#{path}/ios", flutter_root)
        pod name, :path => resolved_path
      else
        puts "Invalid plugin specification: #{line}"
      end
    }
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Here's a link to the Podfile.lock, maybe that's more interesting. I see that it has not been updated with Firestore though, presumably because the run fails: https://pastebin.com/raw/hj2jHE76


回答1:


In case anyone else stumbles across this issue I just wanted to expand on V. Roussel's answer (which I marked as the correct answer), 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.




回答2:


cloud_firestore has progressed to 0.03 by now, which should allow you to run the PODs.

in pubspec.yaml cloud_firestore: "^0.0.3"

If that does not work from the start, add Firebase core to your podfile and run pod install.

Note: As far as I have seen, you cannot yet combine Firestore with other modules such as Firebase auth or Firebase analytics.



来源:https://stackoverflow.com/questions/46717951/cocoapods-error-after-installing-firebase-firestore-flutter-plugin

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