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

Sam*_*Sam 4 ios flutter flutter-ios

我正在尝试构建一个 IOS flutter 项目,但它一直抱怨 pod 的兼容版本。自过去两天以来,我已经尝试了很多线程,但无法解决该问题。不过我的安卓版本运行良好。

我也尝试删除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'
Run Code Online (Sandbox Code Playgroud)

我还尝试了以下命令:

   sudo arch -x86_64 gem install ffi

   arch -x86_64 pod install
Run Code Online (Sandbox Code Playgroud)

当我运行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)
Run Code Online (Sandbox Code Playgroud)

我也尝试过这个线程,但对我不起作用......

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

Tus*_*iya 23

请尝试以下步骤:

如果你有英特尔芯片

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

如果你有M1芯片

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