很久沒更新Cocoapods版本魏滚,最近在項目有用Cocoapods管理私有庫的需求宋渔,就更新了姓建,遇到如下坑:
Cocoapods從0.39版本更新到1.2.0以后
運行報錯:The dependency ......... is not used in any concrete target.
解決辦法:Podfile文件需要指明使用的target缴啡,添加以下代碼:
target '項目名' do
pod .....
解決后仍然報錯:Invalid `Podfile` file: syntax error, unexpected end-of-input, expecting keyword_end.
解決辦法:在Podfile的末尾添加 end
target '項目名' do
pod 公有庫.....
pod '項目名',:git =>'https://github.com/........' ?//私有庫
end?
解決后繼續(xù)報錯: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
解決辦法:升級合并Cocoapods時產(chǎn)生了錯誤优构,刪除重裝
命令行:$ sudo rm -fr ~/.cocoapods/repos/master
? ? ? ? ? ? ? ?$ pod setup
終于能用了....