cocoapods 問題 總結

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

從SVN上更新工程之后運行工程提示錯誤:

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

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

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

接著我就輸入pod setup手動安裝,先出現Setting up CocoaPods master repo,但是它又提示錯誤:

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

真的是無語了,然后在github上找到了答案.

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


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

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

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

OK,現在再執行pod install --no-repo-update就能夠正確更新這些第三方庫了.


但是再次輸入pod search fmdb依然是提示找不到,是因為之前pod search的時候生成了search_index.json,把它刪除掉即可輸入命令:rm ~/Library/Caches/CocoaPods/search_index.json回車

然后再次輸入pod search fmdb會提示

Creating search index for spec repo 'master'..

然后等待即可,最終會出現相關的第三方庫,并顯示

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

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容