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

问题描述 投票:0回答:2

更新我的 pubspect yaml 版本后

firebase_auth: ^1.0.1
firebase_core: ^1.0.2
cloud_firestore: ^1.0.3

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 确实存在。 [请参阅附图][1]

此外,我的 Flutter Doctor 没有显示任何错误。

谢谢,祝一切顺利, -A.V. [1]:https://i.stack.imgur.com/DR2kx.png

flutter upgrade
2个回答
0
投票

在类似问题上对我有用的答案位于https://stackoverflow.com/a/70029467/3120387

  1. 转到项目中的 /ios 文件夹。
  2. 删除Podfile.lock(YourPoject/ios/Podfile.lock)
  3. 删除项目.工作区文件。
  4. 运行 pod install --repo-update (确保您的 cd 进入 flutter 应用程序的 iOS 目录)
  5. 运行 flutter 干净
  6. 完成后,重建您的 Flutter 应用程序:flutter run

0
投票

此错误的通常调用通常归结为尝试调用

pod repo update

如果这不起作用,请删除根目录中的Podfile.lock,然后运行

pod install

对于 M1 Mac 用户,请尝试以下操作:

  1. 转到项目中的ios/Pods/LocalPodspecs目录

  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 的这个答案以获取更多解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.