使用Cocoapods遇到的坑

很久沒更新Cocoapods版本,最近在項(xiàng)目有用Cocoapods管理私有庫的需求,就更新了,遇到如下坑:

Cocoapods從0.39版本更新到1.2.0以后

運(yùn)行報(bào)錯(cuò):The dependency ......... is not used in any concrete target.

解決辦法:Podfile文件需要指明使用的target,添加以下代碼:


target '項(xiàng)目名' do

pod .....


解決后仍然報(bào)錯(cuò):Invalid `Podfile` file: syntax error, unexpected end-of-input, expecting keyword_end.

解決辦法:在Podfile的末尾添加 end


target '項(xiàng)目名' do

pod 公有庫.....

pod '項(xiàng)目名',:git =>'https://github.com/........' ?//私有庫

end?


解決后繼續(xù)報(bào)錯(cuò):Oh no, an error occurred.

Search for existing GitHub issues similar to yours:https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60dirname%27+for+nil%3ANilClass&type=Issues

If none exists, create a ticket, with the template displayed above, on:

https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:

https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

解決辦法:升級(jí)合并Cocoapods時(shí)產(chǎn)生了錯(cuò)誤,刪除重裝

命令行:$ sudo rm -fr ~/.cocoapods/repos/master

? ? ? ? ? ? ? ?$ pod setup

終于能用了....

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容