CocoaPods找不到Pod“ Firebase / Core”的兼容版本| cloud_firestore,Flutter

时间:2018-09-19 05:04:51

标签: firebase flutter google-cloud-firestore

豆荚中出现一些问题,请参见下文

以调试模式在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安装时出错 在iPhone X上启动应用程序时出错。

9 个答案:

答案 0 :(得分:63)

我的设置:VS Code、Flutter

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

  1. 转到项目中的 ios/Pods/Local Podspevs 目录
  2. 检查每个 json 文件以找到所需的最高 ios 版本。其中一些是我的"ios": "10.0"
  3. 返回到 ios/ 目录
  4. 打开 Podfile 个文件
  5. 取消注释 # platform :ios, '9.0' 并将 9.0 替换为 2. step 中的版本,例如 10.0
    • # platform :ios, '9.0' > platform :ios, '10.0'
  6. 运行pod install,错误应该消失了

答案 1 :(得分:11)

pod update

应该做到这一点。不客气:-)

答案 2 :(得分:2)

当您升级FlutterFire软件包并尝试针对iOS或macOS进行构建时,可能会发生此问题,通常是以下情况之一:

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

  2. >

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

  3. 您的Pod规格存储库已过时,这意味着CocoaPods在本地不了解最近发布的Firebase iOS SDK的任何潜在的较新版本。

    解决方案:在终端中运行pod repo update,然后再次尝试构建。

答案 3 :(得分:2)

仅在 pod 文件上取消注释

# platform :ios, '9.0'

并取悦它 platform :ios, '10.0'

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

答案 4 :(得分:1)

我有一个类似的问题。将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解体

运行强制回购更新

pod安装--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.

答案 5 :(得分:1)

我花了将近一个月的时间来解决这些问题。我已经尝试了这篇文章中的所有建议以及我在网上找到的许多其他建议,但没有任何效果。这个问题的真正解决方案是什么?下面是我仍然收到的错误消息,flutter 代码在 Android 上编译得很好,但在 iOS 上一次又一次地失败了。我需要它同时适用于两个平台。我已经构建、未构建、清理、移除、解体、失效、清理缓存、更新存储库、rm -rf'd 一百次,在 Android Studio 中创建了一个全新的项目,但没有任何效果。 Flutter 医生报告一切正常。

我什至从来没有得到要删除的 pubspec.lock 文件,因此任何尝试的建议都不存在。

你说得对,我试过了。

下面的各种输出 - 如果您看到某些内容,请说些什么。我真的可以在这里使用一些急需的帮助 - 将不胜感激!

这是当前在我的 pubspec.yaml 中的内容 - 正如您所看到的,我一直在尝试各种软件包版本的组合来让 pub 安装成功完成 - 这种组合有效 - 其他较新的组合也可以下拉但在尝试为 iOS 编译和运行时,它们最终会失败。

pubspec.yaml

user@Users-MacBook-Pro ios % flutter doctor -v [✓] Flutter (Channel stable, 2.0.2, on Mac OS X 10.15.7 19H512 darwin-x64, locale en-US) • Flutter 2.0.2 版位于 /Users/user/Applications/flutter • 框架修订版 8962f6dc68(3 天前),2021-03-11 13:22:20 -0800 • 引擎修订版 5d8bf811b3 • Dart 版本 2.12.1

[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 30.0.3) • Android SDK 位于 /Users/user/Library/Android/sdk • 平台 android-30,构建工具 30.0.3 • Java 二进制文件位于:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java 版 OpenJDK 运行时环境(构建 1.8.0_242-release-1644-b3-6915495) • 接受所有 Android 许可。

[✓] Xcode - 为 iOS 和 macOS 开发 • Xcode 位于 /Applications/Xcode.app/Contents/Developer • Xcode 12.4,构建版本 12D4e • CocoaPods 1.10.1 版

[✓] Chrome - 为网络开发 • Chrome 位于 /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio(4.1 版) • Android Studio 位于 /Applications/Android Studio.app/Contents • Flutter 插件可以从以下位置安装: ? https://plugins.jetbrains.com/plugin/9212-flutter • Dart 插件可以从以下位置安装: ? https://plugins.jetbrains.com/plugin/6351-dart • Java 版 OpenJDK 运行时环境(构建 1.8.0_242-release-1644-b3-6915495)

[✓] VS 代码(版本 1.54.1) • VS Code 位于 /Applications/Visual Studio Code.app/Contents • Flutter 扩展版本 3.20.0

[✓] 已连接设备(2 个可用) • iPhone 11 Pro Max(手机) • 8F032250-D0B0-4DE6-BCE7-C02F6A4F4082 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7(模拟器) • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.82

• 未发现任何问题! 用户@用户-MacBook-Pro ios %

[!] CocoaPods 无法找到 pod "Firebase/Auth" 的兼容版本: 在 Podfile 中: Firebase/身份验证

               firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 0.20.1, which depends on
                 Firebase/Auth (= 7.3.0)

           CocoaPods could not find compatible versions for pod "Firebase/Database":
             In Podfile:
               Firebase/Database

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

               flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1, which depends on
                 GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
                   Firebase/Database (~> 6.0)

           CocoaPods could not find compatible versions for pod "FirebaseCore":
             In Podfile:
               firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 0.20.1, which depends on
                 Firebase/Auth (= 7.3.0) was resolved to 7.3.0, which depends on
                   FirebaseAuth (~> 7.3.0) was resolved to 7.3.0, which depends on
                     FirebaseCore (~> 7.0)

               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)

答案 6 :(得分:0)

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

解决方案:更新您的部署目标

答案 7 :(得分:0)

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

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

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

答案 8 :(得分:0)

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