使用Cocoapods遇到的坑

2016-12-13  本文已影响19人  InitialNote

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

终于能用了....

上一篇 下一篇

猜你喜欢

热点阅读