[!] Unable to satisfy the following requirements: - `AFNetworking (~> 2.6.1)` required by `Podfile`

错误描述

控制台出现 如此错误:

$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `AFNetworking (~> 2.6.1)` required by `Podfile`

[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

意思大概说你运行一下“$ pod repo update –verbose”检查一下,我运行完一堆语句,我又不懂是什么鬼。

解决错误-solve

  1. $ pod search afnetworking
    结果出来显示最新版本为2.5.2,所以改pod文件。即 pod ‘AFNetworking’, ‘~> 2.5.2’
-> AFNetworking (2.5.2)
   A delightful iOS and OS X networking framework.
   pod 'AFNetworking', '~> 2.5.2'
   - Homepage: https://github.com/AFNetworking/AFNetworking
   - Source:   https://github.com/AFNetworking/AFNetworking.git
   - Versions: 2.5.2, 2.5.1, 2.5.0, 2.4.1, 2.4.0, 2.3.1, 2.3.0, 2.2.4, 2.2.3,
   2.2.2, 2.2.1, 2.2.0, 2.1.0, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0-RC3, 2.0.0-RC2,
   2.0.0-RC1, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.1,
   1.0, 1.0RC3, 1.0RC2, 1.0RC1, 0.10.1, 0.10.0, 0.9.2, 0.9.1, 0.9.0, 0.7.0,
   0.5.1 [master repo]
   - Subspecs:
     - AFNetworking/Serialization (2.5.2)
     - AFNetworking/Security (2.5.2)
     - AFNetworking/Reachability (2.5.2)
     - AFNetworking/NSURLConnection (2.5.2)
     - AFNetworking/NSURLSession (2.5.2)
     - AFNetworking/UIKit (2.5.2)
  1. 反思错误
    - 以后出现问题一步一步查问题
    - 检查Podfile文件 检查 # platform :ios, ‘6.0’ 有没有指定版本这里写图片描述
    - 检查 库的版本。例子:前同事前两天问我Podfile里面这么写的,结果报错:
# platform :ios, '7.0'
  pod 'Alamofire'

后来 我在控制台输入
$ pod search Alamofire
运行结果

Elegant HTTP Networking in Swift
   pod 'Alamofire', '~> 1.1.4'
   - Homepage: https://github.com/Alamofire/Alamofire
   - Source:   https://github.com/Alamofire/Alamofire.git
   - Versions: 1.1.4, 1.1.3 [master repo]

似乎看不出来什么,去官网https://github.com/Alamofire/Alamofire看看,不出所料
这里写图片描述

over!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值