CocoaPods使用问题汇总,更新ing

14,226 阅读1分钟

CDN: trunk URL couldn't be downloaded...

问题1

解决方案: 移除trunk源, 执行pod search时遇到该错误,也是移除trunk

pod repo remove trunk 

如果无法解决问题,在podfile文件中添加以下命令:

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

使用清华的源:

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

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

问题2

解决: 把ruby源切换成清华的,然后执行:

pod repo update --verbose

The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods install

git拉了新代码之后, 运行报此错,终端执行pod install无效 解决方案: 退出Xcode, 再执行pod install之后打开程序即可

Unable to find a pod with name, author, summary, or description matching ...

这种情况需要删除search_index.json文件, 我们直接在终端执行下面的命令就可以了

    rm ~/Library/Caches/CocoaPods/search_index.json

Couldn't determine repo type for URL: https://cdn.cocoapods.org/

执行pod update的时候报了这个错误

pod update错误

$ cd ~/.cocoapods/repos 
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master

上面的命令完成后再在podfile中添加下面一行:

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

CocoaPods could not find compatible versions for pod

dumb http transport does not support shallow capabilities

这个问题安装Cocoapods需要更新Homebrew产生的。 解决方案如下:

1.切换到homebrew-core目录下
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
2. 设置homebrew源为国内的中科大镜像
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
3. 更新
homebrew-coregit -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow