ios - 带有 Firebase 5 的 iOS 上的 GeoFire

标签 ios firebase cocoapods geofire

从 Firebase 4.x 到 Firebase 5.0.0 的更新破坏了我的 GeoFire 安装。我像这样通过“Podfile”安装 GeoFire:

pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'

我现在收到此错误消息:

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

GeoFire (from https://github.com/firebase/geofire-objc.git) was resolved to 2.0.1, which depends on Firebase/Database (~> 4.0) Specs satisfying the Firebase/Database, Firebase/Database (~> 4.0) dependency were found, but they required a higher minimum deployment target.

Podfile 和 Xcode 项目中的部署目标是 iOS 11。因此确实没有更高的最低部署目标。

在本地克隆 repo 并将安装更改为

pod 'GeoFire', :path => '/Users/georg/Projekte/Repos/geofire-objc'

提高对 Firebase 5.0 的依赖似乎也不起作用,因为我现在收到错误消息

[!] The 'Pods-poifinder' target has transitive dependencies that include static frameworks: (FirebaseDatabase, FirebaseCore, FirebaseAuth, FirebaseFirestore, FirebaseFunctions, and FirebaseStorage)

Firebase 已切换到 v5.0.0 的源 pod,这可能是对此的解释。

我现在的问题是:如何让 GeoFire 在 Swift 4.1 项目中与 Firebase 5.0 一起工作。谢谢!

最佳答案

在存储库中修复此问题之前,您可以使用此解决方法:

  1. 在本地克隆存储库
  2. 像这样编辑您的 podfile 并指向本地存储库

    pod 'GeoFire', :path => '/Users/hans/repos/geofire-objc'

  3. 在本地存储库的“GeoFire.podspec”中,像这样编辑依赖项

    s.ios.dependency 'Firebase/Database', '~> 5.0'

  4. 将此行添加到“GeoFire.podspec”:

    s.static_framework = true

  5. 运行

    连播更新

关于ios - 带有 Firebase 5 的 iOS 上的 GeoFire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50294424/

相关文章:

android - Firebase Crashlytics 不与我的 android 项目同步

iOS - 在禁用模块错误时使用@import

syntax-highlighting - GitHub 原子 : How to apply a particular syntax highlighting to some files based on name

ios - 获取谷歌地图的经纬度中心

ios - 使用 swift 将 iOS 应用程序连接到 sockJs 服务器

ios - 从来自服务器的响应中获取总和和平均值

ios - 在特立独行者上安装 cocoa pod

ios - UIPageViewController 不允许识别 UIScreenEdgePanGestureRecognizer

java - 如何从 Firebase 将整数显示到 Textview?

Firebase 查询 endAt() 除了/排除它的键