安装" firebase_firestore"后出现Cocoapods错误Flutter插件

时间:2017-10-12 20:01:53

标签: firebase cocoapods google-cloud-firestore flutter

我已经让我的应用程序使用Firebase RTDB但想要试验Firestore,所以我按照说明操作并安装了' firebase_firestore'插件。

当我现在运行我的应用程序时,我收到以下错误:

 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.

我已尝试在我的Podfile中指定platform :ios, '9.0'10.0,但这并没有任何区别。所有其他pod安装正常。

以下是整个Cocoapods运行日志:https://pastebin.com/raw/SBz8Bqgf

我的Podfile看起来像这样(标准的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

这里是Podfile.lock的链接,也许这更有趣。我发现它还没有使用Firestore更新,大概是因为运行失败了:https://pastebin.com/raw/hj2jHE76

2 个答案:

答案 0 :(得分:2)

如果其他人偶然发现了这个问题,我只想扩展V. Roussel的答案(我将其标记为正确的答案),因为Flutter将这个Cocoapods流程抽象出来。以下是我能够运行“pod repo / update”的方法:

  1. 运行pod repo update
  2. 将环境变量FLUTTER_FRAMEWORK_DIR设置为类似/Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/的内容。您可以locate Flutter.podspec找到此目录
  3. 来自YourFlutterProject/ios运行pod update
  4. 在此之后,您应该可以再次运行您的应用。

答案 1 :(得分:0)

cloud_firestore现在已经发展到0.03,这应该允许你运行POD。

在pubspec.yaml中   cloud_firestore:" ^ 0.0.3"

如果从一开始就不起作用,请将Firebase核心添加到您的podfile并运行pod install。

注意:据我所知,您还无法将Firestore与其他模块(例如Firebase身份验证或Firebase分析)结合使用。