无法使用CocoaPods在Xcode 8.0中安装Alamofire 4.0 [英] Cannot install Alamofire 4.0 in Xcode 8.0 Using CocoaPods

查看:318
本文介绍了无法使用CocoaPods在Xcode 8.0中安装Alamofire 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一个项目升级到Swift 3.0,该项目具有Cocodpods的一些库。
因此,我删除了所有与Cocoapods相关的链接,并使用pod init重新创建了pod文件,并升级了某些版本的库,例如AlamorFire。

但是pod install说

I need to upgrade one project to Swift 3.0, that has some libraries by Cocodpods. So, I've removed all links related with Cocoapods and recreate pod file using pod init and upgrade some version of library such as AlamorFire.
But pod install said

[!] Unable to satisfy the following requirements:

- `Alamofire (~> 4.0)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `Alamofire (~> 4.0)`.

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.

我已将Deployment Target更新为9.0,并使用了cocoapod 1.1.0

为了进行测试,我创建了一个新项目并仅添加了Alamofire,但是结果是相同的。
如果您有经验,请帮助我。

I've updated deployment Target to 9.0 and using cocoapod 1.1.0
For test, I've created new project and added only Alamofire, but the result is same. If you have some experience, please help me.

推荐答案

由于您有过时的Pod回购,因此Pod安装越来越失败了首先,您必须在运行pod安装之前更新pod master仓库。请按照给出的步骤更新您的Pod存储库并解决Pod错误。

Since you have an outdated pod repo, pod install getting failed. First of all you have to update your pod master repo before running pod install. Follow the steps given to update your pod repo and resolve the pod error.


  • 转到Cocoa Pods repo文件夹(〜/ .cocoapods / repos )并删除 master 文件夹

  • 在终端上运行 pod更新

  • 更新完成后,运行 pod install (如果需要)。
  • >
  • Go to Cocoa Pods repo folder (~/.cocoapods/repos) and delete master folder
  • Run pod update on terminal. This will take several minutes to update pod repo.
  • When update get finished, run pod install (if required).

希望这对于那些遇到类似错误的人很有用:)

Hope this would be useful for those who are getting similar error :)

这篇关于无法使用CocoaPods在Xcode 8.0中安装Alamofire 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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