更新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...
    又是夜半驚坐起閱讀 9,891評論 0 23
  • 2015年7月2號,出發前的最后一個夜晚。 2015年7.1號也就是農歷的5月16號。是我的20歲生日,我沒有和我...
    木頭馬尾226閱讀 416評論 2 1
  • 人的容貌會隨著年齡改變,好的身材一定是最減齡的,健康的身體也會讓你更加自信。這就是大家愛運動的理由。 但是想鍛煉的...
    鬧鬧一個閱讀 466評論 4 3
  • 記得上小學時,每到寒假都去姥姥家,一直呆到開學。這也是我一年中最開心的時光。上房頂,去農田里看人們干活、澆地,感到...
    valuepool閱讀 514評論 0 3
  • 今天是88節,呵呵,第一次認真地對待,據說這個節日比6月份的父親節來歷更早一些,只是含義沒有那么廣泛,所以目前只有...
    愛生活挺自己閱讀 119評論 0 1