Error when adding GeoFire library to Xcode, conflicting dependencies

154 Views Asked by At

I am trying to add the GeoFire library to my Xcode project so I can use the geo hash query with firebase. When I copy the GitHub url of the GeoFire library and add it to the Xcode package manager to add I get the error below. I already have Firebase added to my project and it is version 10.16. Do I have to remove firebase and add a previous version such as 8.0 since that's what GeoFire depends on. I simply need to create geo hashes and use them as a query for document search. What's the best way I can achieve this?

photo

"Failed to resolve dependencies Dependencies could not be resolved because 'geofire-objc' depends on 'firebase-ios-sdk' 7.0.0..<9.0.0 and root depends on 'firebase-ios-sdk' 10.16.0..<11.0.0. "

1

There are 1 best solutions below

4
On BEST ANSWER

So you have:

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

And... you cannot downgrade Firebase.

firebase/geofire-objc/Package.swift is clear:

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

And the issue firebase/geofire-objc issue 161 request for Firebase (at least 9.x) for more than a year now.

That issue includes potential workaround:

Ended up using: https://github.com/emilioschepis/swift-geohash.git

Or:

At your Podfile use this and everything will work fine

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