iOS cocoapods相关内容与错误

一、错误
(1)错误:Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1
解决办法:sudo gem install cocoapods-core

(2)错误: CocoaPods could not find compatible versions for pod "BRPickerView":
In Podfile:


image.png

解决:pod install --repo-update
(3)错误:Installing xxx

[!] Error installing xxx
[!] /usr/local/bin/git clone https://github.com/91renb/xxx.git /var/folders/yd/xxx/T/d20210318-9800-gykob8 --template= --single-branch --depth 1 --branch 2.7.3

Cloning into '/var/folders/yd/c87pmc5n5svd_dcqt1890qrm0000gn/T/d20210318-9800-gykob8'...
fatal: unable to access 'https://github.com/91renb/BRPickerView.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

image.png

解决:出现这种情况多半是因为设置了系统代理

取消全局代理即可
git config --global --unset http.proxy
git config --global --unset https.proxy
如果取消全局代理无效,只能翻墙
(4)警告:
Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.


image.png

解释:podfile文件中 使用了中文的单引号’‘ 而非英文下的单引号''

二、内容
(1)podfile文件exec格式转换
终端先cd到根目录
正常格式:终端使用命令chmod 644 Podfile(即文件名) 就会变回正常的了
exec格式:终端使用命令chmod 700 Podfile(即文件名) 就会变回exec格式
(2)清华大学镜像
清华大学镜像可解决Cocoapods install 慢的问题
清华大学镜像网址:https://mirrors.tuna.tsinghua.edu.cn/
pod repo remove master
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
pod repo 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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
禁止转载,如需转载请通过简信或评论联系作者。

推荐阅读更多精彩内容