flutter - Cocoapods 找不到 pod Firebase 的兼容版本

我刚刚从 Windows 10 切换到 Mac。我已经发布了我的 Flutter 应用的 Android 版本。现在我正在开发我的 Flutter 应用程序的 IOS 版本。当我尝试在 Mac 上运行我的应用程序时,出现以下错误。

[!] 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
  mlkit (from `.symlinks/plugins/mlkit/ios`) was resolved to 0.8.3, which depends on
  Firebase/Core (~> 5.11.0)

  CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In Podfile:
  firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 0.0.1, which depends on
  Firebase/Auth (~> 5.19) was resolved to 5.19.0, which depends on
  Firebase/CoreOnly (= 5.19.0)

  mlkit (from `.symlinks/plugins/mlkit/ios`) was resolved to 0.8.3, which depends on
  Firebase/Core (~> 5.11.0) was resolved to 5.11.0, which depends on
  Firebase/CoreOnly (= 5.11.0)

  CocoaPods could not find compatible versions for pod "FirebaseCore":
  In Podfile:
  mlkit (from `.symlinks/plugins/mlkit/ios`) was resolved to 0.8.3, which depends on
  Firebase/Core (~> 5.11.0) was resolved to 5.11.0, which depends on
  Firebase/CoreOnly (= 5.11.0) was resolved to 5.11.0, which depends on
  FirebaseCore (= 5.1.6)

  mlkit (from `.symlinks/plugins/mlkit/ios`) was resolved to 0.8.3, which depends on
  Firebase/Core (~> 5.11.0) was resolved to 5.11.0, which depends on
  FirebaseAnalytics (= 5.3.0) was resolved to 5.3.0, which depends on
  FirebaseCore (~> 5.1)

最佳答案

我通过运行手动 'pod update' 和 Flutter 'Packages get' 解决了这个问题...

在终端更改目录到:

cd FLUTTER_PROJECT_FOLDER_PATH/ios

运行 pod 更新:

pod update

运行 Flutter 包获取

flutter pub get 
  • 那么你应该可以构建到iOS了

  • 第一次构建确实比正常时间长了大约 3 分钟,但在接下来的构建中恢复正常。

https://stackoverflow.com/questions/55840883/

相关文章:

android - 长按时 flutter 触觉反馈

firebase - flutter firestore,在数组中添加新对象

flutter - 在 flutter 中将数据作为对象存储在共享首选项中

flutter - 在 Dart 中添加/减去迄今为止的月/年?

flutter - 如何在 flutter 中修复 'net::ERR_CLEARTEXT_NOT_

dart - 在 Flutter 中,在 pubspec.yaml 文件中添加包的最佳方法是什么?

dart - 如何在 dart 中使用 request.send() 获取响应正文

android - Gradle 失败可能是因为这个 Flutter 应用程序中的 AndroidX

dart - 如何将卡片放入 sliver 应用栏

unicode - 在 Dart 中处理字素簇