使用Cocoapods遇到的坑

很久没更新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 


解决后继续报错: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时产生了错误,删除重装

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

               $ pod setup

终于能用了....

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

推荐阅读更多精彩内容