ios - Pod 安装 Firebase/Analytics 失败
问题描述
我正在使用 Window 10 并尝试使用 Pod 与之集成Firebase/Analytics
,flutter
一切似乎都很好,除了我在运行时遇到此错误pod install
这里是stackTrace
CocoaPods : 1.9.3
Ruby : ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32]
RubyGems : 3.0.3
Host : Unable to find an executable (No such file or directory - sw_vers) ()
Xcode : -version) ()
Git : git version 2.27.0.windows.1
Ruby lib dir : F:/Ruby26-x64/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
这是我的Pod
文件
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
在我podfile
的项目ios
文件夹中flutter
你能帮我解决这个问题吗?
解决方案
您需要更新 pod 存储库。因此,请从命令行尝试以下命令。
pod repo update
如果错误仍然存在,那么您可能需要升级可可豆荚。
sudo gem install cocoapods
在我的颤振项目中集成 Firebase 存储时,我遇到了同样的错误。我做到pod repo update
了,问题消失了。
编辑:
如果您在 pod 文件中手动添加了 firebase 分析 pod,则只需将其删除。
您需要在 Flutter 项目的 .yaml 文件中添加依赖项。
dependencies:
firebase_analytics: ^6.0.0
在这里查看更多详情。
注意:在 Flutter 项目上工作时,除非有非常特殊的要求,否则不需要使用 pod(iOS) 或 gradle(android) 安装任何库。
如果有任何特定的平台要求,那么您需要为 iOS 项目添加 pod 文件,如下所示...
您需要在目标 'Runner' do...end 块中编写 pod 'Firebase/Analytics' 行,如下所示...
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
end
推荐阅读
- apache-camel - 如何使用端点 DSL 配置 HTTP 端点以使用 https 而不是 http?
- php - PHP:检查动态添加的文件上传是否为空
- css - 编译 SCSS 关于使用 '/' 进行除法的警告
- facebook - 如何删除未批准的网址并重新提交 Facebook 即时文章中的文章
- reactjs - React - 如果路径不存在,则重定向到默认路径
- java - Spring Boot 应用程序正在将空值插入到我的 mysql 表中
- java - 如何在 Java(Dropwizard 框架)中进行异步 API 调用以更新 Couchbase 记录?
- flutter - 没有为“AudioPlayer”类定义吸气剂“onDurationChanged”
- c# - 我的网格因 IK 和动画而中断,unity3D
- python-3.x - 尽管 try/except 斐波那契数列停止内核