電腦重裝系統(tǒng),重新安裝cocoaPod的時(shí)候又遇到好多坑。給Podfile中添加好后運(yùn)行終端命令報(bào)錯(cuò)
[!] 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
出這個(gè)錯(cuò)是告訴我們我們所用的庫沒有指定target,它不知道用在哪里,所以就給報(bào)錯(cuò)了。然后到網(wǎng)上搜了一下,找到解決辦法:
官網(wǎng)是這樣給推薦的:
在創(chuàng)建Podfile的時(shí)候,用這種格式使用,
platform: ios, '8.0'
#use_frameworks!個(gè)別需要用到它,比rureactiveCocoa
target 'ODCaiCustomer' do
pod'AFNetworking'
pod'SDWebImage'
pod'SVProgressHUD'
pod'IQKeyboardManager'
end
如果錯(cuò)誤使用use_frameworks!會(huì)報(bào)出以下錯(cuò)誤,因?yàn)閡se_frameworks是switf下使用的時(shí)候使用的。
[!] Invalid `Podfile` file: undefined method `user_frameworks!' for #.
出現(xiàn)這種情況,需要我們自己試著注銷use_frameworks!
這樣再在終端中vim Podfile就可以成功了。