首页 > 解决方案 > 如何将 CocoaPod 添加到 Flutter 项目中?

问题描述

很难找到有关如何将特定 Pod 添加到我的 Flutter 项目以支持 iOS 的任何信息。Podfile 是自动生成的,因此似乎不只是将其添加到 Podfile 是要走的路。还是我完全错了,我应该只更新 Podfile 和git addPodfile 以及它的 .lock 文件?

标签: fluttercocoapods

解决方案


我认为这取决于您的具体情况。作为一般规则,我没有将文件添加到 podfile,尽管我通常必须在我下载的 repos 上执行“podfile install”。

但是,当我不得不这样做时,它总是支持 Firebase。

几个月前我不得不安装firebase并且不得不将它添加到podfile中,我想我看到了这个条目: Flutter Podfile and Firebase

也许还是这样,因为我找到了这个教程,第 4 步表明应该将 firebase SDK 添加到 podfile 中,并且该文章的日期为 2019 年 12 月下旬: https ://www.freecodecamp.org/news/how -to-integrate-your-ios-flutter-app-with-firebase-on-macos-6ad08e2714f0/

所以,我认为答案是“是的……但通常不会”

对于那个项目,我必须将 podfile 添加到 repo,并且我还必须添加 build.gradle 文件,所以我认为它不合适。


推荐阅读