欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

pod install报错踩坑记录

程序员文章站 2024-01-15 08:24:16
...

        最近很久没写技术博客了,在尝试转型项目经理,不过最近有个React Native的项目IOS端需要打包,那就Xcode打包走起呗,在环境都装好后,Xcode打包报错了,之前升级过Mac的系统,需要重新pod install,那就VSCode里进入项目的ios文件夹下pod install走起呗,于是漫长的报错之旅开始了......

        在终端输入pod install后,速度跑起来,终端显示:

Installing AFNetworking (3.2.0)
Installing BVLinearGradient (2.5.6)
Installing CocoaAsyncSocket (7.6.5)
......

        一、Installing Flipper-Glog 时报错:Failed to connect to github.com port 443: Operation timed out,嗯,一看是github连接不通,解决方法:
        1、先ping github.com,如果ping不通,则在“Website Statistics, Domain WHOIS, DNS Records | IPAddress.com”搜索github.com,查看ip;(注意此处需要在该网站自行查找当前github.com的ip,百度上解决方法里的ip都是历史的,我查到的是140.82.113.4;)
        2、将host文件里加入140.82.113.4 github.com,然后ping github.com,ping通了后,此报错解决

        二、Installing Flipper-Glog 时继续报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,很好,跟上个错误不一样了,解决方法:
        1、命令行输入git config --global http.sslBackend "openssl"
        2、然后输入git config --global --add remote.origin.proxy ""
        3、完成以上两步pod install能正常install完Flipper-Glog

        三、install完Flipper-Glog后,发现Installing Flipper-PeerTalk时还是报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,解决方法:重新pod install

        四、install完Flipper-PeerTalk后,发现Installing FlipperKit时还是报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,解决方法:重新pod install

        五、install完FlipperKit后,发现Installing Folly时还是报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,解决方法:重新pod install

         六、install完Folly后,发现Installing GTMBase64时报错:error: RPC failed; curl 16 Error in the HTTP2 framing layer fatal: expected flush after ref listing,

重新pod install,报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,

再重新pod install,报错:LibreSSL SSL_connect: Connection reset by peer in connection to github.com:443,

每次都是不同的错误,重新install pod好像并没有什么卵用,突然想到可能跟之前为了解决Installing Flipper-Glog的报错时百度了很多方法修改了host导致的,果断查看host文件,发现确实有段多的代理,将“151.101.185.194 github.global.ssl.fastly.net”前加个#注释掉就好了

        七、install完GTMBase64后,发现Installing KNSemiModalViewController_hons82 (0.4.5)时报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,

重新pod install,报错:error: RPC failed; curl 56 LibreSSL SSL_read: Connection reset by peer, errno 54
error: 1659 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed,

再重新pod instal后解决

        八、install完KNSemiModalViewController_hons82 (0.4.5)后,发现Installing MJExtension时报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,解决方法:重新pod install

        九、install完MJExtension后,发现Installing Masonry时报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,解决方法:重新pod install

        十、由于白天也还有其他事情要做当时install完Masonry后就想着回去再连Wi-Fi继续吧,晚上回去后继续pod install,结果在Installing OpenSSL-Universal时一直报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,在家里pod install了很多次依然报错,可能是不让我在家里加班吧。等第二天到公司后,连手机热点继续pod install,依然报错LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,尼玛这个OpenSSL-Universal有点特别之处?要不切换个公司的网络试试,因为之前所有的都是连手机热点或者家里Wi-Fi去install,切换公司网络后发现很长一段时间一直显示Installing OpenSSL-Universal,没动了,也不报错也不install完,中断命令,重新pod install了一遍,ok,成功了

        十一、中间还遇到过很多次其他各种安装报错,总之只要看到报错:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,重新pod install就完了;

        最终在多次切换手机热点、家里Wi-Fi、公司网终于安装完了:Pod installation complete! There are 74 dependencies from the Podfile and 65 total pods installed.

        上面可以看到报错最多的就是LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443,然后需要你有足够的耐心不厌其烦的重新pod install,当然如果你的网络足够好的话,估计碰到第一个、第二个报错后,按照相应步骤解决了,应该很快可以install完的!