FireBasecocoa豆荚安装不工作

我正在尝试通过Cocoa Pods为我的Objective-C iOS应用程序安装Firebase。 我的Podfile如下:

target 'RandomName' do pod 'Firebase/Core' pod 'Firebase/AdMob' end 

当我运行pod install ,出现以下错误:

 [!] Unable to satisfy the following requirements: - `Firebase/Core` required by `Podfile` None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`. You have either: * out-of-date source repos which you can update with `pod repo update`. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile. Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default. 

最新版本的Cocoa Pods已经安装,我试过运行pod repo更新。 有一个Podfile以下工作正常,但是当我尝试@import Firebase; 在我的AppDelegate.m文件中,Xcode找不到该模块。

 target 'RandomName' do pod 'Firebase' end 

但是,以下组合不会安装:

 target 'RandomName' do pod 'Firebase' pod 'Firebase/AdMob' end 

任何帮助,将不胜感激!

我有同样的问题。 使用pod“Firebase”时,请检查Firebase的安装版本。 对我来说,它安装了2.4.3这是一个旧版本。 该文档说,该吊舱应该安装3.2。 使用该吊舱。 它解释了为什么其他Pod无法正常工作,因为它们是Firebase 3的一部分。Pod更新不会将Firebase更新为最新版本。 即使强制版本不起作用。 即使它们处于相同的podspec中,也无法find新的Firebase版本。

这是我如何解决它:

  • 确保你已经安装了最新版本的git
  • 确保你安装了cocoapods> = 1.0.0
  • 删除你的豆荚回购(运行pod repo remove master ),并使用pod setup一个新的
  • 在您的pod文件中使用以下内容

    pod 'Firebase/Auth'

    pod 'Firebase/Database'

    pod 'Firebase/Core'

(使用任何你想要的,只是不要使用“Firebase”)

  • pod install
  • 一切都应该正确安装

运行'pod repo remove master'删除Pods repo //删除库

运行'pod setup'//克隆更新的git repo,因为它的大小超过300K需要很长时间(耐心等待!)

运行“pod install”//问题已解决

你有没有尝试添加

框架use_frameworks!

目标'RandomName'行后

并添加

平台:ios,“9.0”

在目标之前….

几个项目尝试。 从你的问题,你做了前两项,但离开这里是为了完整的答案。

  • 您收到的错误响应是有帮助的。 按照pod repo update的步骤进行操作

  • 确保您的pod是最新的。

     pwd> pod --version 1.0.0 
  • 确保你的git是最新的。 我有一个过时的git(1.7)的生成机器,我有同样的确切的错误

当我从git 1.7更新到这个版本,它工作正常。

 pwd> git --version git version 2.8.1 
  • 我的Podfile使用Firebasedynamic链接
  • 从您的.xcodeproj所在的文件夹运行pod init
  • 一定要从这里启动.xcworkspace而不是.xcodeproj。
 platform :ios, '8.0' use_frameworks! target 'the-name-of-target' do pod 'Firebase/DynamicLinks' end 

我只是做下面的步骤来解决这个错误:

 $pod setup -- verbose 

然后做$pod install

适用于我和我的pod文件是:

 source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! target 'the-name-of-target' do pod 'Eureka', '~> 1.6' end 

更新:

然后你可以删除你的主,并使用下面的代码重新安装cocoapods:

 cd ~/.cocoapods/repos rm -rf master pod setup 

我有同样的错误,我的解决scheme是将Cocoapods降级到1.0.0 ,因为Cocoapods 1.0.1没有按预期工作。 一切都很好,现在!

  • sudo gem uninstall cocoapods -v 1.0.1

  • sudo gem install cocoapods -v 1.0.0

我的Podfile

 platform :ios, '8.0' target 'XXX' do pod 'Firebase/Auth' pod 'Firebase/Database' end 

7月12日Aadi007的回答解决了我的问题。 在运行这三个命令之前澄清一下

 pod repo remove master pod setup pod install 

需要在Finder中删除pods文件夹以及.xcworkspace和profile.lock文件。

pod安装命令中发生同样的问题。

请重新启动terminal,然后导航到您的Xcode项目

只需激发相同的pod安装命令。 'Firebase /数据库'将成功安装:)