错误:CocoaPods的规范库已过时,无法满足依赖关系。要更新CocoaPods规范,请运行:pod repo update。

3
当我尝试使用 "flutter run" 命令运行 flutter ios 项目时,会出现以下错误:
`Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update`
同时也会出现以下错误:
`Error running pod install`
然后我在 ios/ 目录下运行了 "pod install" 命令,但是出现以下错误:
`[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly": In Podfile: firebase_core (from .symlinks/plugins/firebase_core/ios) was resolved to 1.12.0, which depends on Firebase/CoreOnly (= 8.11.0)
None of your spec sources contain a spec satisfying the dependency: Firebase/CoreOnly (= 8.11.0).
You have either: - out-of-date source repos which you can update with pod repo update or with pod install --repo-update. - mistyped the name or version. - not added the source repo that hosts the Podspec to your Podfile.`
我尝试了 "pod install --repo-update" 命令,但是还是出现了相同的错误。请问您能否帮我解决这个问题?

你能分享一下你的 Podfile 吗? - tomerpacific
https://1drv.ms/t/s!Aljz9e21ww1GiTA_dINqcmbVM-Vb?e=KoLIHI,点击此处 - Vepa Sabyrow
你能分享一下你的YAML文件吗?以及用你的YAML文件创建的Pod文件。 - Maziar Saadatfar
2个回答

8

您应该前往iOS文件夹并删除:

pods文件夹和podfile.lock文件

enter image description here

接下来,您应该将以下行添加到yaml文件中

  firebase_core: ^1.12.0         "[last version in dev dart]"
  firebase_analytics: ^8.3.4     "[last version in dev dart]"
  firebase_crashlytics: ^2.3.0.  "[last version in dev dart]"
  firebase_messaging: ^11.1.0.   "[last version in dev dart]"

运行您的应用程序以安装和更新Pod文件


3
非常感谢。我尝试了这个方法,但最终是通过使用“pod repo remove trunk”和“pod install”解决了这个问题。 - Vepa Sabyrow

3

这可以通过删除Podfile.lock和pods文件夹,并更新以下包来解决:

firebase_core: ^1.12.0
firebase_analytics: ^8.3.4
firebase_crashlytics: ^2.3.0.
firebase_messaging: ^11.1.0.

然后先运行

pod repo remove trunk

最后运行

pod install


删除Trunk仓库 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接