Firebase CocoaPods 安装不起作用 [英] Firebase CocoaPods Installation Not Working

查看:29
本文介绍了Firebase CocoaPods 安装不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to install Firebase via CocoaPods for my Objective-C iOS Application. My Podfile is as follows:

target 'RandomName' do

pod 'Firebase/Core'
pod 'Firebase/AdMob'

end

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

When I run pod install, I get the following error:

[!] 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.

安装了最新版本的 CocoaPods,我尝试运行 pod repo update.拥有以下 Podfile 工作正常,但是当我尝试在我的 AppDelegate.m 文件中 @import Firebase; 时,Xcode 找不到该模块.

The latest version of CocoaPods is installed, and I have tried running pod repo update. Having a Podfile of the following works fine, but when I try to @import Firebase; in my AppDelegate.m file, Xcode cannot find the module.

target 'RandomName' do

pod 'Firebase'

end

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

However, the following combination does not install:

target 'RandomName' do

pod 'Firebase'
pod 'Firebase/AdMob'

end

任何帮助将不胜感激!

推荐答案

我遇到了同样的问题.检查使用 pod 'Firebase' 时安装的 Firebase 版本.对我来说,它安装的是旧版本 2.4.3.文档说 pod 应该安装 3.2.使用那个吊舱.它解释了为什么其他 Pod 无法工作,因为它们是 Firebase 3 的一部分.Pod 更新也不会将 Firebase 更新到最新版本.即使强制一个版本也不起作用.即使它们在同一个 podspec 中,似乎也找不到新的 Firebase 版本.

I am having the same problem. Check what version of Firebase is installed when you use pod 'Firebase'. For me it installs 2.4.3 which is an old version. The docs say that the pod should install 3.2. using that pod. It explains why the other pods don't work as they are part of Firebase 3. Pod update doesn't update Firebase to the latest version either. Even forcing a version doesn't work. It can't seem to find the new Firebase versions even though they are in the same podspec.

我是这样解决的:

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

  • make sure you have the latest version of git installed
  • make sure you have cocoapods >= 1.0.0 installed
  • delete your pods repo (run pod repo remove master) and use pod setup to make a new one
  • use the following in your pod file

pod 'Firebase/Auth'

pod 'Firebase/Database'

pod 'Firebase/Core'

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

(use whatever you want, just don't use 'Firebase')

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

这篇关于Firebase CocoaPods 安装不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆