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

问题描述:

我已经将我的应用程序与Firebase RTDB配合使用,但想试验Firestore,因此我按照说明安装了'firebase_firestore'插件。安装“firebase_firestore”Flutter插件后出现Cocoapods错误

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

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但没有任何区别。所有其他豆荚安装正常。

这里就是整个的CocoaPods运行日志:https://pastebin.com/raw/SBz8Bqgf

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

+1

请更新您的问题以包含您的'Podfile'中的代码。 –

+0

Hi @JenPerson - 我添加了Podfile + Cocoapods运行日志。 Podfile是AFAIK的一个标准的Flutter Podfile,不能记得对它做出改变(除了试图指定平台版本) –

如果有其他人在这个问题上绊倒,我只是想扩大V. Roussel的答案(我标记为正确答案) ,因为Flutter类将这个Cocoapods过程抽象出来。这里就是我所做的能够运行“吊舱回购/更新”:

  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

在这之后,你应该能够再次运行你的应用程序。

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

在pubspec.yaml cloud_firestore:“^ 0.0.3”

如果不从一开始工作,添加火力地堡的核心您podfile和运行荚安装。

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

+0

嗨,请参考你的笔记 - 结合Firestore和其他人(Auth/Firebase RTDB等)直到最近一直工作良好 - 这是由引用不同版本的底层Firebase软件包的各种Flutter软件包引起的回归。这个问题在这里跟踪:https://github.com/flutter/flutter/issues/12945 –

+1

嘿比约恩,我做了即将到来。我确实在那里发布了问题https://github.com/flutter/flutter/issues/13341,它解决了问题12945,因为我无法使其工作。 现在我不希望将我的项目直接附加到GIT绳上,也不希望它成为示例集的一部分。 猜猜我只需要等待,直到修复程序在普通Aplha设置中普遍可用。 感谢您指出它。 –