将 GeoFire 库添加到 Xcode 时出错,依赖项冲突

问题描述 投票:0回答:1

我正在尝试将 GeoFire 库添加到我的 Xcode 项目中,以便我可以在 firebase 中使用地理哈希查询。当我复制 GeoFire 库的 GitHub url 并将其添加到 Xcode 包管理器进行添加时,出现以下错误。我已经将 Firebase 添加到我的项目中,版本为 10.16。我是否必须删除 firebase 并添加以前的版本(例如 8.0),因为这是 GeoFire 所依赖的。我只需要创建地理哈希并将其用作文档搜索的查询。我实现这一目标的最佳方法是什么?

“无法解析依赖项无法解析依赖项,因为‘geofire-objc’依赖于‘firebase-ios-sdk’7.0.0。<9.0.0 and root depends on... • unexpectedly did not find the new dependency in the package graph: sourceControl(identity: geofire-objc, location: SwiftPM.SPMPackageDependency.Sourc..."

ios xcode firebase google-cloud-firestore geofire
1个回答
0
投票

所以你有:

┌───────────────┐        ┌────────────────┐
│   Xcode       │        │  GeoFire       │
│  Project      │        │  Library       │
│               │        │                │
│  ┌─────────┐  │        │  Depends on    │
│  │ Firebase│  │        │  Firebase      │
│  │ 10.16   │  │        │  7.0.0.<9.0.0  │
│  └─────────┘  │        └────────────────┘
└───────────────┘

而且...您无法降级 Firebase。

firebase/geofire-objc/Package.swift
很清楚:

    dependencies: [
        .package(name: "Firebase",
                 url: "https://github.com/firebase/firebase-ios-sdk.git",
                 "7.0.0"..<"9.0.0"),
    ],

以及对 Firebase(至少 9.x)的问题

firebase/geofire-objc
问题 161 请求已经一年多了。

该问题包括潜在的解决方法:

最终使用:https://github.com/emilioschepis/swift-geohash.git

或者:

在你的 Podfile 中使用这个,一切都会正常工作

pod 'GeoFire', :git => 'https://github.com/abdoelmorap/geofire-objc', :tag => '5.4.0'
© www.soinside.com 2019 - 2024. All rights reserved.