ios - 如何明智地将 FirebaseFirestoreSwift 与 Carthage 结合使用?

标签 ios swift firebase google-cloud-firestore cocoapods

我在找方法FirebaseFirestoreSwift和迦太基共存。

我正在使用 FirebaseFirestoreFirebaseFirestoreSwift和其他 Firebase 框架。
通常使用 Cocoapods,但构建非常重,需要很长时间。

所以我尝试使用迦太基。

幸运的是我找到了公共(public)迦太基 github .
通过这个,我能够转换为使用 Firebase 框架到 carthage。
但是没有FirebaseFirestoreSwiftBinary .

我仅将 Cocoapods 用于 FirebaseFirestoreSwift ,因为没办法。
但它甚至下载并构建了相关的FirebaseFirestore ,抹去迦太基的好处。

然后我尝试下载 podspec 并使用未设置依赖项的本地 podspec,如下所示:
FirebaseFirestoreSwift .我删除了第 39 行。

但是这种方式是失败的。未能建立。
因为 FirebaseFirestoreSwift 有 import FirebaseFirestore
我想使用 $ {SRCROOT} /Carthage/Build/iOS/FirebaseFirestore.framework但想不出好办法。

有没有人有一个好主意或成功的方法?

最佳答案

构建二进制文件的步骤如下:

  • 下载此文件夹并解压https://github.com/firebase/firebase-ios-sdk
  • 导航到 ZipBuilder 文件夹 /firebase-ios-sdk-master/ReleaseTooling/Sources/ZipBuilder
  • 创建以下文件pods.json其中包含:
  • [
      {
        "name": "FirebaseFirestoreSwift"
      }
    ]
    
  • 接下来我们需要运行 ZipBuilder构建二进制文件的工具。 Docs for ZipBuilder. .
  • 以下命令swift run zip-builder --zip-pods $(pwd)/pods.json将构建 FirebaseFirestore.swift适用于各种不同的架构。有关如何使用 ZipBuilder 的更多信息,请访问 swift run zip-builder --help
  • 关于ios - 如何明智地将 FirebaseFirestoreSwift 与 Carthage 结合使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59591715/

    相关文章:

    ios - 更改 UIViewController 的方向会影响另一个 UITableViewController 的边界

    android - Prestashop 语言标志图标在移动设备上看起来很糟糕

    ios - swift :- Thread 1: Fatal error: Remainder of or division by zero

    node.js - webpack 仅捆绑 firebase/database 而不是 firebase/auth

    firebase - 慢速 firestore runTransaction 调用

    ios - 为 iOS 构建 OpenCV

    ios - 自定义字体未在某些模拟器上显示

    ios - Swift如何在播放暂停后保持锁定屏幕音频控件可用

    ios - 如何在 Swift 中重用字体?

    ios - 通过 FaSTLane "the server responded with status 404"分发 Firebase 应用程序