更新Cocoapods碰到的问题及处理经过

最近在用cocoapods导入第三方库的时候出现如下错误,现在将错误处理放发一步步贴出来:

1、当导入一些第三方库的时候如:

pod 'Masonry', '~> 1.0.2'

pod 'MBProgressHUD', '~> 1.0.0'

pod 'YYAsyncLayer', '~> 1.0.0'

pod 'THLabel', '~> 1.4.8'

pod 'AFNetworking', '~> 3.1.0'

pod 'TMCache', '~> 2.1.0'

pod 'JSONModel', '~> 1.5.1'

pod 'SSZipArchive', '~> 1.5.0'

1、

当你执行pod install时出现了下面的报错:

[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)

这就是说我们的cocopods版本太旧,是currently using 0.39.0这个,这个master需要CocoaPods 1.0.0 的版本

2、

那执行 sudo gem update cocoapods   更新cocopods 就又提示了下面这个错误:

Updating cocoapods

ERROR:  While executing gem ... (Errno::EPERM)

3、接下来执行sudo gem install -n /usr/local/bin cocoapods --pre

就可以成功的更新了cocopods的版本,采用pod —version 查看cocopods的版本号1.0.0~1.2.0

4、接下来执行pod install 的时候,又会出现如下错误

pod install

Re-creating CocoaPods due to major version update.

Analyzing dependencies

[!] The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.

The dependency `SDWebImage (~> 3.7.6)` is not used in any concrete target.

The dependency `UITableView+FDTemplateLayoutCell (~> 1.5.beta)` is not used in any concrete target.

The dependency `MJRefresh (~> 3.1.0)` is not used in any concrete target.

The dependency `SVProgressHUD (~> 2.0.3)` is not used in any concrete target.

The dependency `FMDB (~> 2.6.2)` is not used in any concrete target.

The dependency `MJExtension (~> 3.0.10)` is not used in any concrete target.

The dependency `RealReachability` is not used in any concrete target.

The dependency `CocoaLumberjack` is not used in any concrete target.

The dependency `GPUImage (~> 0.1.7)` is not used in any concrete target.

The dependency `TTTAttributedLabel` is not used in any concrete target.

The dependency `Masonry (~> 1.0.2)` is not used in any concrete target.

The dependency `MBProgressHUD (~> 1.0.0)` is not used in any concrete target.

The dependency `YYAsyncLayer (~> 1.0.0)` is not used in any concrete target.

The dependency `THLabel (~> 1.4.8)` is not used in any concrete target.

The dependency `TMCache (~> 2.1.0)` is not used in any concrete target.

The dependency `JSONModel (~> 1.5.1)` is not used in any concrete target.

The dependency `SSZipArchive (~> 1.5.0)` is not used in any concrete target.

The dependency `FLEX (~> 2.0)` is not used in any concrete target.

这个问题产生的可以通过 $ pod --version 查看版本号;

原因是podfile升级到最新版本,pod里的内容必须明确指出所用第三方库的target;可以修改Podfile文件的配置文件,让它兼容不指定固定版本;且又不报错;

platform:ios, '8.0'

inhibit_all_warnings!

target ‘XXXProjectName’ do

pod 'AFNetworking', '~> 3.1.0'

pod 'SDWebImage', '~> 3.7.6'

pod 'UITableView+FDTemplateLayoutCell', '~> 1.5.beta'

pod 'MJRefresh', '~> 3.1.0'

pod 'SVProgressHUD', '~> 2.0.3'

pod 'FMDB', '~> 2.6.2'

pod 'MJExtension', '~> 3.0.10'

pod 'RealReachability'

pod 'CocoaLumberjack'

pod 'GPUImage', '~> 0.1.7'

pod 'TTTAttributedLabel'

pod 'Masonry', '~> 1.0.2'

pod 'MBProgressHUD', '~> 1.0.0'

pod 'YYAsyncLayer', '~> 1.0.0'

pod 'THLabel', '~> 1.4.8'

pod 'TMCache', '~> 2.1.0'

pod 'JSONModel', '~> 1.5.1'

pod 'SSZipArchive', '~> 1.5.0'

pod 'FLEX', '~> 2.0', :configurations => ['Debug']

end

其中XXXProjectName要换成当前target名,最后不要忘记增加一个end结尾。

如果工程中有多个target要引用,可以参考下面的链接进行处理:

http://www.cnblogs.com/wujy/p/5545680.html

本文参考了 博客园 踏浪帅的博主的文章:更新Cocopods碰到的问题及知识点,上面链接就是此片博文的地址。

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

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,413评论 0 23
  • 2015年7月2号,出发前的最后一个夜晚。 2015年7.1号也就是农历的5月16号。是我的20岁生日,我没有和我...
    木头马尾226阅读 3,064评论 2 1
  • 人的容貌会随着年龄改变,好的身材一定是最减龄的,健康的身体也会让你更加自信。这就是大家爱运动的理由。 但是想锻炼的...
    闹闹一个阅读 3,283评论 4 3
  • 记得上小学时,每到寒假都去姥姥家,一直呆到开学。这也是我一年中最开心的时光。上房顶,去农田里看人们干活、浇地,感到...
    valuepool阅读 3,440评论 0 3
  • 今天是88节,呵呵,第一次认真地对待,据说这个节日比6月份的父亲节来历更早一些,只是含义没有那么广泛,所以目前只有...
    爱生活挺自己阅读 812评论 0 1