CocoaPods报错:The dependency 'xxx' is not used in any concrete target

CocoaPods升级后(最新版本1.0.0),安装第三方库的时候会报如下错误:

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

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

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

原因:CocoaPods升级后,Podfile文件的内容格式要求发生了变化,必须指出指出所用第三方库的target。

解决步骤:

     (1)检查CocoaPods的版本

            pod --version

      (2) 升级或安装最新版本(目前版本1.0.0)

           注意:如果cocoapods已经是1.0.0版本,则跳过该步骤直接进入第三个步骤。

           升级命令: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。

 

通过以上三个步骤 问题完美解决   ^_^

 

posted @ 2016-06-07 18:22  AppLiu  阅读(2035)  评论(3编辑  收藏  举报