The sandbox is not in sync with the Podfile.lock-ios

Run 'pod install' or update your CocoaPods installation.

You have answer in the error itself !

The error message states that you should update your CocoaPods installation.

You could remove libPods in frameworks and libraries and update Cocoapods using pod install.

Also:

clean and build the project

SO references :

CocoaPods Errors on Project Build

Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods


For me, the reason was missign User-Defined variables in the Build Settings!

Looking into the issue, the Build Phases tries to diff 2 files.

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null

Just because of missing PODS_PODFILE_DIR_PATH and PODS_ROOT variables, assumes them as "" so ${PODS_PODFILE_DIR_PATH}/Podfile.lock points to /Podfile.lock and same for the other one.
So it fails in

diff /Podfile.lock and /Manifest.lock

I fixed this by adding 2 User-Defined settings to the Build Settings

PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.

After hours of searching this is the only solution that worked for me


For me, it works after the following:

pod deintegrate --verbose    
pod install --verbose