1.pod install失敗
在執(zhí)行pod install
的時(shí)候會(huì)失敗,提示如下:
[!] CocoaPods could not find compatible versions for pod "MJRefresh":
In Podfile:
MJRefresh (~> 3.5.0)
None of your spec sources contain a spec satisfying the dependency: `MJRefresh (~> 3.5.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
按提示執(zhí)行pod install --repo-update
之后,還是失敗,提示:
[!] CocoaPods could not find compatible versions for pod "MJRefresh":
In Podfile:
MJRefresh (~> 3.5.0)
None of your spec sources contain a spec satisfying the dependency: `MJRefresh (~> 3.5.0)`.
You have either:
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
造成報(bào)錯(cuò)的原因有兩種:
-
一、兩者的都是由于本地索引庫沒有更新到最新,找不到對(duì)應(yīng)版本的spec文件。
-
二、第三方庫依賴的系統(tǒng)版本號(hào),高于項(xiàng)目的最低支持版本,要解決只能升級(jí)最低支持的版本或者不升級(jí)第三方庫。這就是為什么
pod search
成功,但pod install
的原因,當(dāng)然也有可能是某個(gè)第三方庫也依賴了這個(gè)庫,不過我記得報(bào)錯(cuò)不是這樣的,會(huì)提示某個(gè)庫依賴這個(gè)庫的某個(gè)版本。
第一種按如下方法執(zhí)行:
// 以本地master的實(shí)際目錄為準(zhǔn):
cd ~/.cocoapods/repos/master
Git pull
執(zhí)行完這兩個(gè)命令之后,再執(zhí)行pod install
即可,參考
不過以上方法可能比較耗時(shí),并且下載了很長(zhǎng)時(shí)間也會(huì)失敗,這里推薦你使用第三步
中的方法,方便不耗時(shí)!
2.cocoapods升級(jí)
執(zhí)行:
sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
3.SSL_ERROR_SYSCALL
提示:
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
主要是cocoapods下載spec文件的速度太慢,個(gè)人喜歡到下面的地址直接下載,即Podfile
文件的引入源。
https://github.com/CocoaPods/Specs.git
解壓完成之后將文件命名為master
, 然后打開~/.cocoapods/repos/
刪除repos文件下的master
,將我們下載的master
文件替換進(jìn)來,打開終端執(zhí)行:
pod setup
完成之后,就可以正常執(zhí)行pod install
操作了。類似下面的報(bào)錯(cuò)也可以解決:
fatal: unable to access 'https://github.com/hackiftekhar/IQKeyboardManager.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
以上方法也可以解決類似443
、56
、54
的問題,如果不能解決參考Pod\Ruby更新提示443
4.日常更新
最近發(fā)現(xiàn)還是會(huì)有443
這類的問題出現(xiàn),之前都能pod install下來的庫,現(xiàn)在升級(jí)確不行(個(gè)別庫,因?yàn)樾略龅哪躨nstall下來),一直失敗報(bào)錯(cuò),有說需要清除本地代理配置:
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
之后執(zhí)行pod install
,正常執(zhí)行,由于升級(jí)的庫較多,只成功了一次,之后又試了一次pod install
,全部更新完畢!文章來源:http://www.zghlxwxcb.cn/news/detail-704713.html
這里有一點(diǎn)問題,因?yàn)楸镜氐呐渲貌]有設(shè)置過代理,感覺和這個(gè)關(guān)系也不大。從實(shí)際情況來看多執(zhí)行幾次pod install
就可以了,并不需要做額外的操作文章來源地址http://www.zghlxwxcb.cn/news/detail-704713.html
到了這里,關(guān)于iOS pod install失敗,提示CocoaPods could not find compatible versions for pod “***“的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!