CocoaPods報錯:The dependency 'xxx' is not used in any concrete target

CocoaPods升級後(最新版本1.0.0),安裝第三方庫的時候會報以下錯誤:ios

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

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

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

緣由:CocoaPods升級後,Podfile文件的內容格式要求發生了變化,必須指出指出所用第三方庫的target。blog

解決步驟:get

     (1)檢查CocoaPods的版本io

            pod --versionform

      (2) 升級或安裝最新版本(目前版本1.0.0)class

           注意:若是cocoapods已是1.0.0版本,則跳過該步驟直接進入第三個步驟。sed

           升級命令:sudo gem update -n /usr/local/bin --system

 

     安裝命令:sudo gem install -n /usr/local/bin cocoapods

      (3)修改Podfile的內容

        修改前的Podfile文件的內容:      

platform:ios,'7.0'
pod 'MJRefresh', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.6'
pod 'SVProgressHUD', '~> 2.0.3'
pod 'AFNetworking', '~> 3.1.0'

   修改後的Podfile文件的內容:

platform:ios,'7.0'
target "MyTarget" do
pod 'MJRefresh', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.6'
pod 'SVProgressHUD', '~> 2.0.3'
pod 'AFNetworking', '~> 3.1.0'
end

  在Podfile文件中須要明確指出使用第三方庫的target。

 

經過以上三個步驟 問題完美解決   ^_^

相關文章
相關標籤/搜索