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

電腦重裝系統(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就可以成功了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容