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。

 

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

相关文章
相关标签/搜索