安装CocoaPods报错:[!] The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.

今天新机装cocopods时,等安装完毕发觉出现[!] The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.这个警告。看了下版本: 1.0.1 react

 

 

 

解决方式:ios

官网是这样给推荐的: code

在建立Podfile的时候,用这种格式使用,orm

platform :ios, '8.0'
#use_frameworks!个别须要用到它,好比reactiveCocoa

target 'TestPod' do
  pod 'AFNetworking', '~> 2.6'
  pod 'ORStackView', '~> 3.0'
  pod 'SwiftyJSON', '~> 2.3'
end

里面的 TestPod 记得替换为本身工程里面的target。这样就基本OK了,执行pod install / pod update 就均可以了。(use_frameworks! 这个是个别须要的)get

下面是另一种写法,io

platform :ios, '8.0'
#use_frameworks!个别须要用到它,好比reactiveCocoa

def pods
  pod 'AFNetworking', '~> 2.6'
  pod 'ORStackView', '~> 3.0'
  pod 'SwiftyJSON', '~> 2.3'
end
target 'TestPod' do
  pods
end
相关文章
相关标签/搜索