Flutter Firebase Pubspec.yaml 更新-- 获取 [!] CocoaPods 无法找到与“Firebase/CoreOnly”兼容的版本:

3
更新我的pubspec.yaml版本后,来自的文本。
firebase_auth: ^1.0.1
firebase_core: ^1.0.2
cloud_firestore: ^1.0.3

to

firebase_auth: ^1.1.2
firebase_core: ^1.1.0
cloud_firestore: ^1.0.7

我得到了以下输出:
checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
      In snapshot (Podfile.lock):
        Firebase/CoreOnly (= 7.3.0)

      In Podfile:
        firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.1.0, which depends on
          Firebase/CoreOnly (= 7.11.0)


    You have either:
     * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
     * changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_core`.
       You should run `pod update Firebase/CoreOnly` to apply changes you've made.

在 iOS 文件夹内运行 'pod init' 之后,我得到了这个结果。
[!] No Xcode project found, please specify one

在 iOS 文件夹中运行 'pod install' 后,
[!] No `Podfile' found in the project directory.

然而,Podfile确实存在。 [请参考附加的图片] 此外,我的Flutter Doctor未显示任何错误。
谢谢,祝一切顺利, -A.V.

你好!我通过简单地删除iOs包内的Podfile文件,然后在IOS包内运行以下命令的混合体来解决了这个问题——只需选择此文件夹并在终端中输入以下内容:'pod install'、'pod repo update'和'pod update'。这使我的Pod能够下载与FirebaseCore/仅有的软件包兼容的版本。 - Andrew Villegas
2个回答

0

我在类似问题上的解决方案是在https://dev59.com/7Kz2oIgBc1ULPQZFf6eR#70029467找到的。

  1. 进入项目中的 /ios 文件夹。
  2. 删除 Podfile.lock (YourPoject/ios/Podfile.lock) 文件。
  3. 删除 Project.Workspace 文件。
  4. 运行 pod install --repo-update (确保你已经 cd 到 flutter 应用程序的 iOS 目录下)。
  5. 运行 flutter clean 命令。
  6. 完成后,重新构建 Flutter 应用程序:flutter run。

0
通常对于这个错误的解决方法就是尝试调用pod repo update
如果这个方法不起作用,可以删除根目录下的Podfile.lock文件,然后运行pod install
对于M1 Mac用户,请尝试以下步骤:
1. 进入项目中的ios/Pods/Local Podspecs目录。 2. 检查每个json文件,找到所需的最高iOS版本。在我的一些文件中是"ios": "10.0"。 3. 返回到ios/目录。 4. 打开Podfile文件。 5. 取消注释# platform :ios, '9.0'并将9.0替换为第2步中的版本,例如10.0。 6. 运行sudo arch -x86_64 gem install ffi。 7. 运行arch -x86_64 pod repo update。 8. 运行arch -x86_64 pod install error应该已经消失了。 9. 如果使用Flutter,请使用cd -返回到根目录,打开iOS模拟器并运行flutter run
查看来自SO的这个答案,获取更多解决方案。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接