firebase - 安装 "firebase_firestore"Flutter插件后Cocoapods报错

标签 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

最佳答案

如果其他人偶然发现这个问题,我只是想扩展 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

在此之后,您应该能够再次运行您的应用。

关于firebase - 安装 "firebase_firestore"Flutter插件后Cocoapods报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46717951/

相关文章:

firebase - $firebaseSimpleLogin 和无需重新登录的 session

ios - Сocoapods 中继 URL 无法下载

cocoapods - 从 Xcode 项目中删除特定的 pod

ios - 自定义 Cocoapod 总是返回 "No such module XXX"

java - 无法使用 Recycler view android 加载更多数据分页

ios - Firebase iOS swift : Prevent Duplicate Usernames

javascript - 使用云函数将函数值添加到 firestore 中

带有 firebase Push 方法的 javascript 在聊天页面中显示值两次或多次。每当我返回页面并来到聊天页面时

javascript - 如何从整个集合中获取最后添加的文档。开快照

ios - 从 Cloud Firestore 获取四个随机但唯一的文档 - Swift