gpt4 book ai didi

ios - fatal error : module 'cloud_firestore' not found

转载 作者:行者123 更新时间:2023-12-03 11:15:54 26 4
gpt4 key购买 nike

每次我尝试将 Cloud Firestore 添加到我的 Flutter 项目时都会收到此错误。我首先在我的主要项目中尝试了它,但它失败了。我在一个干净的新项目上尝试了它,每次都得到相同的结果。我已经阅读了至少 10 篇不同的帖子,其中有人遇到了这个错误。它都没有奏效。我尝试删除 Pods 和 Podfile/Podfile.lock 并生成新的。我尝试使用最新的依赖项“cloud_firestore:^0.14.0”。

这是我的 pubspec.yaml:

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:

cloud_firestore: ^0.14.0

flutter:
sdk: flutter


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3

dev_dependencies:
flutter_test:
sdk: flutter


这是我的 Podfile(它的一部分):
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Runner

end

# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

pod 'Firebase/Firestore'

我越来越痛苦了,因为我花了两天时间看 YouTube 视频,查看我能查到的任何文章,我不骗你,没有任何效果。我什至联系了 Firebase 支持以获得一些答案,但我还没有得到任何回复。
如果您碰巧知道我该如何解决这个问题,我将非常感激!

最佳答案

相信我,我搜索了超过 5 个小时,尝试了我在互联网上可以找到的所有解决方案。只有一项工作:

  • 删除 Podfile、Podfile.lock、Pods 文件夹
  • flutter 干净
  • cd ios
  • pod deintegrate(这样 pod 不会重新安装旧的库)
  • cd ../
  • flutter 跑

  • 大多数解决方案不包括第 4 步,所以即使您清理并重新安装 pod,它的行为仍然相同。
    在开发人员处,我们可以在 2 小时内学习如何反转二叉树,并在一天多的时间里为安装步骤而苦苦挣扎,这是作为开发人员最烦人的事情之一。

    关于ios - fatal error : module 'cloud_firestore' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64015602/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com