1

我在 iOS 上使用 Firebase,我想添加 GeoFire。我正在按照此处的说明进行操作:https ://github.com/firebase/geofire-objc ,但是在将 pod 'GeoFire', '>=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

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

4

2 回答 2

2

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

  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. 通常你会完成并且很好,但是目前有一个重大错误,但幸运的是,社区在几个小时后找到了一个修复 - 在 XCode 项目导航器中导航到:Pods -> Pods -> Firebase Database -> Frameworks -> SELECT/亮点 FirebaseDatabase.framework

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

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

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

于 2016-07-22T21:47:30.550 回答
0

你用的是什么版本的 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。

于 2016-05-27T20:14:02.220 回答