CocoaPods "sandbox is not in sync with the Podfile.lock" in CI
Xcode found that the installed Pods directory does not match Podfile.lock. CI did not run pod install, or it ran with a different lockfile.
What this error means
The build fails with The sandbox is not in sync with the Podfile.lock. Run pod install. It reproduces until the Pods directory is regenerated to match the committed lockfile.
xcodebuild
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.Common causes
pod install was skipped in CI
The job built the workspace without installing Pods, so the Pods directory is stale or absent.
Podfile.lock changed but Pods were not regenerated
A dependency bump updated the lockfile while the checked-out or cached Pods reflect the old state.
How to fix it
Run pod install before building
- Install Pods as a setup step so the sandbox matches the lockfile.
- Build the .xcworkspace, not the .xcodeproj, after installing.
shell
pod install --repo-update
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp buildCommit a consistent Podfile.lock
Regenerate locally with pod install, commit the updated Podfile.lock, and keep it in sync with the dependencies you intend to ship.
How to prevent it
- Always run pod install in CI and commit Podfile.lock. Cache the CocoaPods spec repo to speed installs. On Latchkey managed runners, self-healing auto-retries transient pod fetch failures and larger runners speed up installs.
Related guides
CocoaPods "could not find compatible versions for pod" in CIFix the CocoaPods "could not find compatible versions for pod" error in CI by relaxing version constraints or…
Flutter "CocoaPods not installed" (flutter ios) in CIFix the Flutter "CocoaPods not installed or not in valid state" error in CI by installing CocoaPods on the ma…
React Native "CocoaPods could not find compatible versions" in CIFix the React Native CocoaPods "could not find compatible versions" error in CI by reinstalling node_modules…