1. 程式人生 > >iOS \'The sandbox is not sync with the Podfile.lock\'問題解決

iOS \'The sandbox is not sync with the Podfile.lock\'問題解決

問題描述:

github下載的Demo,很多時候使用到CocoaPods,有的時候因為依賴關係或者版本問題不能編譯執行。出現例如The sandbox is not sync with the Podfile.lock問題時候,如下所示

diff: /../Podfile.lock: No such file or directory 
diff: Manifest.lock: No such file or directory 
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.` 

解決方案

關閉當前的工作空間,刪除掉資料夾中的workspace,然後重新pod install,install完成之後,通過workspace開啟工作空間,clean+build即可,如下所示

rm -rf MyProject.xcworkspace 
pod install 

在pod install之前,請確保已經執行pod setup命令。