cocoapods 問(wèn)題 總結(jié)

原文地址 :https://www.cnblogs.com/i-am-lvjiazhen/p/6148703.html

從SVN上更新工程之后運(yùn)行工程提示錯(cuò)誤:

Thesandbox is not in sync with thePodfile.lock.Run'pod install'or update yourCocoaPodsinstallation.`

平時(shí)只要在終端輸入pod install就好,但是今天卻出錯(cuò)了,提示[!] Unable to find a specification for `FMDB`

然后我在終端輸入pod search fmdb,結(jié)果竟然提示:[!] Unable to find a pod with name, author, summary, or description matching `fmdb`

接著我就輸入pod setup手動(dòng)安裝,先出現(xiàn)Setting up CocoaPods master repo,但是它又提示錯(cuò)誤:

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git [...] -- [...]'

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git [...] -- [...]'

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git [...] -- [...]'

$ /usr/bin/git -C /Users/lv/.cocoapods/repos/master pull --ff-only

真的是無(wú)語(yǔ)了,然后在github上找到了答案.

先移除掉本地的master,在終端輸入pod repo remove master


然后轉(zhuǎn)到路徑下,在終端輸入cd?~/.cocoapods/repos

再把github上的spec下載下來(lái),替換路徑~/.cocoapods/repos目錄下的master

接著在終端輸入命令:git clone --depth 1 https://github.com/CocoaPods/Specs.git master,等待下載完畢

OK,現(xiàn)在再執(zhí)行pod install --no-repo-update就能夠正確更新這些第三方庫(kù)了.


但是再次輸入pod search fmdb依然是提示找不到,是因?yàn)橹皃od search的時(shí)候生成了search_index.json,把它刪除掉即可輸入命令:rm ~/Library/Caches/CocoaPods/search_index.json回車(chē)

然后再次輸入pod search fmdb會(huì)提示

Creating search index for spec repo 'master'..

然后等待即可,最終會(huì)出現(xiàn)相關(guān)的第三方庫(kù),并顯示

Creating search index for spec repo 'master'.. Done!

?著作權(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)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

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

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