美文网首页
使用Cocoapods遇到的坑

使用Cocoapods遇到的坑

作者: InitialNote | 来源:发表于2016-12-13 15:04 被阅读19次

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

    终于能用了....

    相关文章

      网友评论

          本文标题:使用Cocoapods遇到的坑

          本文链接:https://www.haomeiwen.com/subject/yznjsttx.html