【问题标题】:CocoaPods could not find compatible versions for pod "Firebase/Core” | cloud_firestore, FlutterCocoaPods 找不到 pod“Firebase/Core”的兼容版本 | cloud_firestore, Flutter
【发布时间】:2019-02-23 04:33:46
【问题描述】:

我在 pod 中遇到了一些问题,请参见下文

在 iPhone X 上以调试模式启动 lib/main.dart... 正在运行 pod 安装... CocoaPods 的输出: ↳ 准备中

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`

Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Core

Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Core was resolved to 5.8.0, which depends on
        FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
          GoogleUtilities/MethodSwizzler (~> 5.2.0)

Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "gRPC-Core":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Firestore was resolved to 5.8.0, which depends on
        FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
          gRPC-C++ (~> 0.0.3) was resolved to 0.0.3, which depends on
            gRPC-C++/Implementation (= 0.0.3) was resolved to 0.0.3, which depends on
              gRPC-Core (= 1.14.0)

    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Firestore was resolved to 5.8.0, which depends on
        FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
          gRPC-ProtoRPC (~> 1.0) was resolved to 1.14.1, which depends on
            gRPC-ProtoRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
              gRPC (= 1.14.1) was resolved to 1.14.1, which depends on
                gRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
                  gRPC-Core (= 1.14.1)

/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/resolver.rb:123:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:781:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:779:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:88:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

CocoaPods 的错误输出: ↳ [33m警告:CocoaPods 要求您的终端使用 UTF-8 编码。 考虑将以下内容添加到 ~/.profile:

    export LANG=en_US.UTF-8
    [0m

[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

运行 pod install 时出错 在 iPhone X 上启动应用程序时出错。

【问题讨论】:

  • 同样的问题,没有解决办法......
  • 我没有找到任何解决上述问题的方法,但是将颤振降级到旧的 dart 1 和 cloud_firestore 7.4 将避免这些问题。但弹出一些其他的.. 像这个' atal error: 'GoogleUtilities/GULAppEnvironmentUtil.h' file not found #import ^~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ '

标签: ios firebase flutter cocoapods podfile


【解决方案1】:

Cocoapods 拒绝更新到最新的 Firebase,因为依赖项需要更高的最小部署目标。

您需要更新自己应用的部署目标,或使用旧版本的 firebase SDK。

【讨论】:

    【解决方案2】:

    我也有类似的问题。将 Project、Target 和 Podfile 设置为 iOS 12 并失败。

    这是我的 Podfile:

    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '12.0'
    use_frameworks!
    
    abstract_target 'all_pods' do
        pod 'Alamofire'
        pod 'AlamofireImage'
        pod 'AlamofireNetworkActivityIndicator'
        pod 'Atributika'
        pod 'AXPhotoViewer'
        pod 'Cache'
        pod 'Crashlytics'
        pod 'Fabric'
        pod 'Firebase/Core'
        pod 'Firebase/Messaging'
        pod 'Google-Mobile-Ads-SDK'
        pod 'GTMNSStringHTMLAdditions'
        pod 'KVLoading'
        pod 'MGSwipeTableCell'
        pod 'ReachabilitySwift'
        pod 'SDCAlertView'
        pod 'SideMenuSwift'
        pod 'SwiftyJSON'
        pod 'SwiftyUserDefaults'
        pod 'UIImageViewAlignedSwift'
    
    target 'Test Poject' do
    #    all_pods
    end
    
    end
    

    先解体确定

    吊舱解体

    运行强制回购更新

    pod install --repo-update

    Updating local specs repositories
    $ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master fetch origin --progress
      remote: Counting objects: 9, done.        
      remote: Compressing objects: 100% (9/9), done.        
      remote: Total 9 (delta 6), reused 0 (delta 0), pack-reused 0        
      From https://github.com/CocoaPods/Specs
         8b2bcbd42ee..f72b5a3a02a  master     -> origin/master
      $ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
      master
      $ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master reset --hard origin/master
      HEAD is now at f72b5a3a02a [Add] DSJSONSchemaValidation 2.0.4
    
    CocoaPods 1.6.0.beta.1 is available.
    To update use: `sudo gem install cocoapods --pre`
    [!] This is a test version we'd love you to try.
    
    For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0.beta.1
    
    Analyzing dependencies
    [!] CocoaPods could not find compatible versions for pod "Firebase/Core":
      In Podfile:
        Firebase/Core
    
    Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
    CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
      In Podfile:
        Firebase/Core was resolved to 5.8.0, which depends on
          FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
            GoogleUtilities/MethodSwizzler (~> 5.2.0)
    
    Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
    

    【讨论】:

    • Update 我通过将这一行添加到我的 Podfile 中来实现这一点: pod 'Firebase', '~> 5.7'
    【解决方案3】:
    pod update
    

    应该做的伎俩。不客气:-)

    【讨论】:

    • 我收到此错误:Analyzing dependencies [!] CocoaPods 找不到 pod 的兼容版本
    • 这将更新您的所有 pod,但您可能不想要。我认为 Random Code Money 的解决方案更好。基本清除项目中的Cocoapod缓存,重新安装。
    • 只是为了澄清。如果使用 Android Studio --> Press Terminal --> cd ios --> pod update
    【解决方案4】:

    当您升级 FlutterFire 软件包并尝试为 iOS 或 macOS 构建时,可能会发生此问题,这通常归结为以下原因之一:

    这里有一些原因和他们的解决方案

    1. 突破性壮举:将端口转发到 firebase-ios-sdk v7.3.0。
    • 由于此次 SDK 升级,iOS 10 现在是 FlutterFire 支持的最低版本。请更新您的构建目标版本。

      解决方案

      转到项目中的文件ios/Podfile,然后取消注释

      # platform :ios, '9.0'
      

      然后将版本改为10

      platform :ios, '10.0'
      

      然后返回 ios/ 目录并在终端中运行 pod install 并再次尝试构建。

    1. 您在 iOS 或 macOS 目录中的 Podfile.lock 版本已过期并锁定为旧版本的 Firebase iOS SDK,而新升级的 FlutterFire 软件包可能使用这些 SDK 的较新版本。

      解决方案:删除Podfile.lock 文件并再次尝试构建。此文件将在下一个pod install 之后重新生成。

    2. 您的 pod 规格存储库已过期,这意味着本地的 CocoaPods 不知道最近发布的任何潜在的 Firebase iOS SDK 新版本。

      解决方案:返回 ios/ 目录并在终端中运行 pod repo update 并再次尝试构建。

    【讨论】:

    • 删除 podfile.lock 为我解决了这个问题
    • 这解决了我的问题。
    【解决方案5】:

    我遇到了同样的问题,但这对我有帮助。

    pod 'Firebase/Core', '>= 0'
    pod 'FirebaseCrashlytics', '>= 0'
    

    它将 FirebaseCore 和 FirebaseCrashlytics 更新到最新版本

    【讨论】:

      【解决方案6】:

      我的设置:VS Code、Flutter

      如果您没有Podfile.lock 文件并且pod update 没有帮助,请尝试以下操作:

      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
        • # platform :ios, '9.0' > platform :ios, '10.0'
      6. 运行pod install,错误应该消失了

      【讨论】:

      • 是的,我也这样做了,成功了。我认为 Flutterfire 团队需要修复他们的依赖关系
      • 同意 @ShazamoMorebucks 这很麻烦,我相信 YouTube 上技术负责人关于 Flutter 的 cmets 有很多优点。我不认为 Flutter 是一个长期解决方案,因为它从根本上被许多从未解决的问题所打破。
      • 重要的是不要忘记取消注释 # platform :ios, '9.0' 行,因为它是默认注释的,可能不会立即看到。
      • 这个解决方案对我来说是止痛药。谢谢。
      • 很高兴成为您的第 100 个赞!
      【解决方案7】:

      我在使用 firebase Admob 时遇到了类似的问题,我的问题是我同时使用了 admob_flutter 和 firebase_admob 包。一旦我从 pubspec.yaml 中删除了 admob_flutter 包,一切正常!

      【讨论】:

        【解决方案8】:

        就在 pod 文件上取消注释

        # platform :ios, '9.0'

        并用 platform :ios, '10.0'

        然后删除 Podfile.lock 并重新安装您的应用

        【讨论】:

        【解决方案9】:

        我遇到了这个问题:

        为了解决这个问题,我打开了 Podfile。那么

        1. 如其他答案中所述,我取消了 platform: ios, '8.0' 的注释并将其替换为 platform :ios, '10.0'

        2. 我替换了以下代码:

        target 'Runner' do
          pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.3.0'
          use_frameworks!
          use_modular_headers!
          
          flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
        end
        
        post_install do |installer|
          installer.pods_project.targets.each do |target|
            flutter_additional_ios_build_settings(target)
          end
        end
        

        使用此代码:

        target 'Runner' do
          use_frameworks!
          use_modular_headers!
        
          flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
          pod 'Firebase/Core'
          pod 'Firebase/Crashlytics'
          pod 'Firebase/Analytics'
        end
        
        post_install do |installer|
          installer.pods_project.targets.each do |target|
            flutter_additional_ios_build_settings(target)
            target.build_configurations.each do |config|
              config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
              config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
              config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
              config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
            end
          end
        end
        
        1. 在终端中,我在ios 文件夹中运行了以下命令。
        $ pod install
        

        一切顺利。我没有看到任何问题,但有很多与Installing FirebaseX... 相关的绿色日志,最后我收到了这条消息:

        Pod installation complete! There are 8 dependencies from the Podfile and 24 total pods installed.
        

        【讨论】:

          【解决方案10】:

          解决问题(Intelli J)

          1. 查看IOS flutter文件夹Podfile.lock是否生成。

          2. 运行“flutter doctor -v”来识别 Flutter、Dart、Xcode 和 CocoaPods 的版本。

          3. 如果找不到可可豆荚,请按照安装命令。

            sudo gem 卸载 cocoapods brew卸载cocoapods

            sudo gem 安装 cocoapods 吊舱设置

          4. 在 Podfile - 未注释的平台:ios,'9.0' 并将其替换为平台:ios,'10.0'。

          5. 运行构建

            正在调试模式下在 iPhone 12 Pro Max 上启动 lib/main.dart... 正在运行 pod 安装... 运行 Xcode 构建... Xcode 构建完成。

          enter image description here

          【讨论】:

            【解决方案11】:

            对我来说是这样的:

            1. 转到文件 %project%/ios/.symlinks/plugins/firebase_core/ios/firebase_sdk_version.rb
            2. 将此def firebase_sdk_version!() '8.7.0' end 更改为def firebase_sdk_version!() '8.5.0' end
            3. 运行pod install

            【讨论】:

              【解决方案12】:

              在您的 Podfile 中,添加您想在您的应用中使用的 Firebase pod。

              平台:ios,‘10.0’

              为 Google Analytics 添加 Firebase pod

              pod 'Firebase/Analytics'

              对于没有 IDFA 收集功能的 Analytics,请改用此 pod

              pod ‘Firebase/AnalyticsWithoutAdIdSupport’

              为您想在应用中使用的任何其他 Firebase 产品添加 pod

              例如,使用 Firebase 身份验证和 Cloud Firestore

              pod 'Firebase/Auth' pod 'Firebase/Firestore'

              【讨论】:

                【解决方案13】:

                这 3 个步骤对我有用。

                1. 将 cocoapods 升级到最新版本:

                  sudo gem install cocoapods

                2. 删除/Pods文件夹和Podfile.lock文件

                3. 运行pod repo update

                【讨论】:

                  【解决方案14】:

                  在 mac M1(在 ios 文件夹中)上,尝试 arch -x86_64 pod update。为我工作

                  【讨论】:

                    【解决方案15】:

                    我必须在 Podfile 中更新。
                    pod 'FirebaseFirestore', :git =&gt; 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag =&gt; '8.0.0'.
                    到新版本。
                    pod 'FirebaseFirestore', :git =&gt; 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag =&gt; '8.9.1'

                    【讨论】:

                      【解决方案16】:

                      我遇到了类似的错误:

                      已找到满足 `firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)` 依赖项的规范,但它们需要更高的最小部署目标。


                      什么对我不起作用:

                      根据其他答案,我去了Podfile 并更新:

                      • 来自:# platform :ios, '9.0'
                      • 至:platform :ios, '13.0'

                      然后再次尝试flutter run,但这次卡在了:

                      Running Xcode build....

                      等待是不自然的,我的耐心越来越少,所以我放弃了这个改变并寻找另一个解决方案。


                      最后,什么对我有用:

                      1. flutter clean
                      2. flutter pub get
                      3. flutter run

                      无需修改Podfile指定最小ios目标?

                      【讨论】:

                      • 为我工作!谢谢:)
                      猜你喜欢
                      • 2021-07-21
                      • 1970-01-01
                      • 2021-11-13
                      • 1970-01-01
                      • 2020-10-19
                      • 2021-03-31
                      • 2022-11-04
                      • 2021-03-19
                      相关资源
                      最近更新 更多