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

电脑重装系统,重新安装cocoaPod的时候又遇到好多坑。给Podfile中添加好后运行终端命令报错

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

The dependency `SDWebImage` is not used in any concrete target.

The dependency `SVProgressHUD` is not used in any concrete target.

The dependency `IQKeyboardManager (~> 4.0.5)` is not used in any concrete target

出这个错是告诉我们我们所用的库没有指定target,它不知道用在哪里,所以就给报错了。然后到网上搜了一下,找到解决办法:

官网是这样给推荐的:

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

platform: ios, '8.0'

#use_frameworks!个别需要用到它,比rureactiveCocoa

target 'ODCaiCustomer' do

pod'AFNetworking'

pod'SDWebImage'

pod'SVProgressHUD'

pod'IQKeyboardManager'

end

如果错误使用use_frameworks!会报出以下错误,因为use_frameworks是switf下使用的时候使用的。

[!] Invalid `Podfile` file: undefined method `user_frameworks!' for #.

出现这种情况,需要我们自己试着注销use_frameworks!

这样再在终端中vim Podfile就可以成功了。

你可能感兴趣的:(The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target)