【问题标题】:Adding GeoFire dependency with CocoaPods使用 CocoaPods 添加 GeoFire 依赖项
【发布时间】:2016-05-27 18:19:07
【问题描述】:

我在 iOS 上使用 Firebase,我想添加 GeoFire。我按照这里的说明进行操作:https://github.com/firebase/geofire-objc,但在添加 pod 之后 '地火', '>=1.1' 到我的 podfile 并更新我得到错误

$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `Firebase (~> 2.1)` required by `GeoFire (1.1.0)`

Specs satisfying the `Firebase (~> 2.1)` dependency were found, but they required a higher minimum deployment target.

我的 podfile 看起来像

use_frameworks!
platform :ios, '8.1'

pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/AdMob'
pod 'Firebase/Auth'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/RemoteConfig'

pod 'GeoFire', '>=1.1'

target 'FriendlyChatSwift' do
end

我不确定这里发生了什么。

【问题讨论】:

    标签: ios firebase cocoapods geofire


    【解决方案1】:

    请按顺序执行这些步骤,因为其中一个应该可以解决问题:

    1. 将 Cocoapods 更新到最新版本 (1.0.1)。

    2. 在您的项目 podfile 中删除 pod 'GeoFire', '>=1.1' 行。

    3. 在终端中转到您的项目所在的文件夹并运行:

      吊舱更新

    4. 现在回到 Podfile 并以这种方式添加 GeoFire:

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

    5. 在终端中转到您的项目所在的文件夹并运行:

      吊舱安装

    6. 为了以防万一(黑魔法?)

    7. ,我在安装后再次运行 pod 更新以防万一
    8. 通常你会完成并且很好,但目前存在一个重大错误,但幸运的是,社区在多个小时后找到了修复 - 在 XCode 项目导航器中导航到:Pods -> Pods -> Firebase 数据库 - > 框架 -> SELECT/HIGHLIGHT FirebaseDatabase.framework

    9. 选择/突出显示 FirebaseDatabase.framework 后,查看文件检查器(最右侧,纸质图标)并选择/选中 Target Membership 下的 GeoFire。

    这是第 7/8 步的屏幕截图链接:https://cloud.githubusercontent.com/assets/1798166/16071528/6e625fd8-330e-11e6-97ca-655bea333fbb.png

    最后确保您在 GitHub 上查看项目的“问题”部分 - 这是一个很好的资源,您将来可能会在那里找到解决方案。

    【讨论】:

      【解决方案2】:

      您使用的是什么版本的 cocoapods?他们最近刚刚发布了 1.0。您可能想尝试一下。

      另外,这是最新的 geofire podspec 文件:

      Pod::Spec.new do |s|
        s.name         = "GeoFire"
        s.version      = "1.1.2"
        s.summary      = "Realtime location queries with Firebase."
        s.homepage     = "https://github.com/firebase/geofire-objc"
        s.license      = { :type => 'MIT', :file => 'LICENSE' }
        s.author       = { "Firebase" => "support@firebase.com" }
        s.source       = { :git => "https://github.com/firebase/geofire-objc.git", :tag => 'v1.1.2' }
        s.source_files = "GeoFire/**/*.{h,m}"
        s.docset_url   = "https://geofire-ios.firebaseapp.com/docs/"
        s.ios.deployment_target = '7.0'
        s.osx.deployment_target = '10.10'
        s.ios.dependency  'Firebase', '~> 2.2'
        s.osx.dependency  'FirebaseOSX', '~> 2.4'
        s.framework = 'CoreLocation'
        s.requires_arc = true
      end
      

      尝试在您的 podfile 中提取 geofire 1.1.x。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-04-11
        • 1970-01-01
        • 2018-03-05
        • 2018-07-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多