使用CocoaPods添加GeoFire依赖项

时间:2016-05-27 18:19:08

标签: ios firebase cocoapods geofire

我在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

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

2 个答案:

答案 0 :(得分:2)

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

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

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

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

    pod update

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

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

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

    pod install

  6. 为了更好的衡量,我在安装后再次运行pod更新,以防万一(BLACK MAGIC?)

  7. 通常情况下你会完成并且很好去但是目前存在一个主要的错误但幸运的是在几个小时之后社区找到了一个修复 - 导航到XCode Project导航器:Pods - >豆荚 - > Firebase数据库 - >框架 - >选择/突出显示FirebaseDatabase.framework

  8. 选择/突出显示FirebaseDatabase.framework后,请查看文件检查器(最右侧的纸张图标),然后在目标成员资格下选择/选中/勾选GeoFire。

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

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

答案 1 :(得分:0)

您使用的是哪种版本的cocoapod?他们刚刚发布了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.

相关问题