首页 > 代码库 > CocoaPods报错:The dependency `AFNetworking ` is not used in any concrete target
CocoaPods报错:The dependency `AFNetworking ` is not used in any concrete target
最近更新了下cocoapods,今天再pod update 就遇到这个错误:
大体意思就是说,库没有用到指定的target。
找了下资料,发现是新版CocoaPods在 Podfile里使用时,必须指定target:
比如:
platform:ios,‘7.0‘ target ‘TestSwift’ do pod ‘AFNetworking‘ pod ‘SDWebImage‘ pod ‘JSONModel‘ pod ‘MJRefresh‘ pod ‘SDCycleScrollView‘,‘~> 1.64‘ end
解决方法:
添加
target ‘TestSwift’ do
end
这两段首尾声明即可。
注意:TestSwift是你的target名
其实,在旧版本,如果我们一个项目里含多个target时,要在不同target里引用第三方库,也是必须指定具体target的,只不过现在升级后,要求即使一个target,也要指定一下,这样就是更正规一点了。
CocoaPods报错:The dependency `AFNetworking ` is not used in any concrete target
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。