Cocoapod 1.9.1 问题解决

https://blog.csdn.net/u012709932/article/details/105044238

一直想pod search AFNetworking
...但是用不了

[!] CDN: trunk Repo update failed - 17 error(s): CDN: trunk URL couldnt be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/1/d/4/CocoaAsyncSocket/0.0.1/CocoaAsyncSocket.podspec.json, error: Operation timed out - SSL_connect ...

...

解决办法

1,首先要安装 Xcode 命令行工具

xcode-select --install

2,查看版本

pod --version

3,查看gem

gem sources

如果不是源:https://gems.ruby-china.com ,使用以下方式增加新源:

添加源

gem sources -a https://gems.ruby-china.com

删除之前的源

gem sources --remove https://gems.ruby-china.org/

然后查看源:

gem sources

4,使用源安装CocoaPods

git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master

如果特别慢,使用以下源安装CocoaPods

git clone https://gitee.com/mirrors/CocoaPods-Specs.git ~/.cocoapods/repos/master

然后执行以下命令:

pod setup

使用CocoaPods:

打开podfile文件指定旧方式下载。

**// source** 源地址

**source** ‘**https://github.com/CocoaPods/Specs.git**’

我这边pod文件里写的是

source 'https://gitee.com/mirrors/CocoaPods-Specs.git'

platform:ios,'9.0'
use_frameworks!

在执行Pod Search AFNetWorking的时候,发现终端输出以下错误:

[!] CDN: trunk URL couldn't be downloaded: xxxxxx

经查,需要执行如下操作,即可正常搜索

执行pod repo remove trunk移除trunk源,pod search就都正常了!

源使用可以如下

platform:ios,'9.0'

source 'https://gitee.com/mirrors/CocoaPods-Specs.git'

use_frameworks!

target "" do

….

遇到如下问题

[!] Unable to find a specification for

执行

pod update --verbose

总是兜兜转转 我就留了一个master然后 竟然可以了


image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容