Flutter CocoaPods 找不到 pod“FirebaseCore”的兼容版本

Posted

技术标签:

【中文标题】Flutter CocoaPods 找不到 pod“FirebaseCore”的兼容版本【英文标题】:Flutter CocoaPods could not find compatible versions for pod "FirebaseCore" 【发布时间】:2021-11-13 19:58:12 【问题描述】:

我正在尝试构建一个 ios Flutter 项目,但它一直在抱怨 pod 的兼容版本。自最近两天以来,我已经尝试了很多线程,但无法解决问题。但是我的 android 版本运行良好。

我也尝试删除 podfile.lock、podfile、pod 文件夹、Runner.xcworkspace,但没有任何效果。现在我没有 podfile.lock 文件了。我的意思是 podfile.lock 没有被创建。

我使用的是 macOS Big Sur 11.6 版。

MacBook Pro 2019

处理器:2.3 GHz 8 核英特尔酷睿 i9

在我的 Podfile 中:

       platform :ios, '10.0'

我还尝试了以下命令:

   sudo arch -x86_64 gem install ffi

   arch -x86_64 pod install

当我运行 pod install 命令时,出现以下错误。

        Analyzing dependencies
        cloud_firestore: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        cloud_functions: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_analytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_crashlytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_database: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_in_app_messaging: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_messaging: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        firebase_storage: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
        [!] CocoaPods could not find compatible versions for pod "FirebaseCore":
        In Podfile:
            firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 0.7.0, which depends on
            Firebase/CoreOnly (= 7.3.0) was resolved to 7.3.0, which depends on
                FirebaseCore (= 7.3.0)

            firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 6.0.0, which depends on
            Firebase/Database (= 7.3.0) was resolved to 7.3.0, which depends on
                FirebaseDatabase (~> 7.3.0) was resolved to 7.3.0, which depends on
                FirebaseCore (~> 7.0)

            google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
            GoogleMLKit/LinkFirebase (~> 2.2.0) was resolved to 2.2.0, which depends on
                MLKitLinkFirebase (~> 1.3.0) was resolved to 1.3.0, which depends on
                FirebaseCore (~> 8.0)

        CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
        In Podfile:
            firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) was resolved to 7.0.1, which depends on
            Firebase/Analytics (= 7.3.0) was resolved to 7.3.0, which depends on
                Firebase/Core (= 7.3.0) was resolved to 7.3.0, which depends on
                FirebaseAnalytics (= 7.3.0) was resolved to 7.3.0, which depends on
                    GoogleAppMeasurement (= 7.3.0)

            google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`) was resolved to 0.0.1, which depends on
            Google-Mobile-Ads-SDK (= 8.5.0) was resolved to 8.5.0, which depends on
                GoogleAppMeasurement (< 9.0, >= 7.0)

        CocoaPods could not find compatible versions for pod "MLKitCommon":
        In Podfile:
            google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
            GoogleMLKit/BarcodeScanning (~> 2.2.0) was resolved to 2.2.0, which depends on
                GoogleMLKit/MLKitCore (= 2.2.0) was resolved to 2.2.0, which depends on
                MLKitCommon (~> 3.0.0)

            google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
            GoogleMLKit/BarcodeScanning (~> 2.2.0) was resolved to 2.2.0, which depends on
                MLKitBarcodeScanning (~> 1.3.0) was resolved to 1.3.0, which depends on
                MLKitCommon (~> 3.0)

            google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
            GoogleMLKit/PoseDetectionAccurate (~> 2.2.0) was resolved to 2.2.0, which depends on
                MLKitPoseDetectionAccurate (~> 1.0.0-beta4) was resolved to 1.0.0-beta5, which depends on
                MLKitCommon (~> 3.1)

        CocoaPods could not find compatible versions for pod "MLKitXenoCommon":
        In Podfile:
            google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
            GoogleMLKit/PoseDetection (~> 2.2.0) was resolved to 2.2.0, which depends on
                MLKitPoseDetection (~> 1.0.0-beta4) was resolved to 1.0.0-beta5, which depends on
                MLKitXenoCommon (= 1.0.0-beta5)

            google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
            GoogleMLKit/PoseDetectionAccurate (~> 2.2.0) was resolved to 2.2.0, which depends on
                MLKitPoseDetectionAccurate (~> 1.0.0-beta4) was resolved to 1.0.0-beta4, which depends on
                MLKitXenoCommon (= 1.0.0-beta4)

我也尝试了this 线程,但对我不起作用...

任何帮助将不胜感激...

【问题讨论】:

检查这个答案。 ***.com/a/69248774/6681858 【参考方案1】:

请尝试以下步骤:

如果你有英特尔芯片

    扑干净 将所有依赖项更新到 pubspec.yml 文件中的最新版本并执行“get pub” 转到您的 Podfile 并取消注释 #platform :ios, '9.0' 然后将版本更改为 10 platform :ios, '10.0' 通过终端转到 ios 文件夹并执行“pod repo update” “pod 更新”或“pod 安装”

如果你有 M1 芯片

    扑干净 将所有依赖项更新到 pubspec.yml 文件中的最新版本并执行“get pub” 转到您的 Podfile 并取消注释 #platform :ios, '9.0' 然后将版本更改为 10 platform :ios, '10.0' 通过终端转到 ios 文件夹并执行“arch -x86_64 pod repo update” 'arch -x86_64 pod update'或'arch -x86_64 pod install'

【讨论】:

我刚刚发现我的 Macbook Pro 正在英特尔芯片上运行。我尝试了第一个选项,但是当我运行“por update”或“pod install”时它仍然给出相同的错误。我的 pubspec.yaml 有版本:1.0.0+1 和 sdk:">=2.7.0 @Sam 我不是在谈论 pubspec.yaml 版本。我说的是所有库版本,如 firebase_core、google_ml_kit 等。请更新最新版本并执行步骤。 感谢 Tushar 的回复。实际上,当我执行“dart pub outdated”时,它会向我展示我的应用程序的可升级版本(不是最新版本)。我使用的是可升级版本本身,但不是最新版本。 谢谢,将我的所有依赖项更新到最新版本后,问题就消失了……谢谢

以上是关于Flutter CocoaPods 找不到 pod“FirebaseCore”的兼容版本的主要内容,如果未能解决你的问题,请参考以下文章

Flutter CocoaPods 找不到 pod“FirebaseCore”的兼容版本

Flutter IOS:CocoaPods 找不到 pod“simple_permissions”的兼容版本:

Flutter CocoaPods 找不到兼容版本:Cache 和 BetterPlayer

CocoaPods 找不到 pod“Capacitor”的兼容版本

Cocoapods:找不到“PRIVATE POD”依赖的“PUBLIC POD”规范

Cocoapods:找不到“Firebase/Core”的规范