the sandbox is not sync with the podfile.lock

github下载的Demo, 很多时候使用到pods, 有的时候因为依赖关系或者版本问题不能编译运行. 出现如 The sandbox is not sync with the Podfile.lock 问题的时候, 如下所示

1
2
3
4
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.

解决方法:

关闭当前的项目, 删掉项目文件夹中的.xcworkspace, 重新pod install, install 完成之后, 通过新生成的.xcworkspace打开项目, clean+build即可, 如下所示

1
2
rm -rf MyProject.xcworkspace
pod install