Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Xcode build fails: 'The sandbox is not in sync with the Podfile.lock'

Errorerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

Short answer

A build phase named Check Pods Manifest.lock compares Podfile.lock with Pods/Manifest.lock and stops the build when they differ. That means the Pods folder was installed from a different Podfile.lock than the one now in your project. Run pod install from the Podfile folder, then build from the workspace.

  • Applies to CocoaPods 1.16, Xcode 16, Xcode 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run the same comparison the build phase runs. If it prints differences, the two lockfiles disagree.

    diff Podfile.lock Pods/Manifest.lock
  2. 2Match what you see, then jump to its fix

    1. 1The error follows a git pull, a branch switch or an edit to the Podfile.The Podfile or Podfile.lock changed and pod install was not runFix
    2. 2Works on your Mac, fails in CI or on a new machine where Pods/ is not committed.CI or a fresh clone builds without installing podsFix
    3. 3Podfile.lock is missing, or two different copies exist.The lockfile is not committed, or pod install ran in the wrong folderFix

What does the error look like?

  • error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
  • Command PhaseScriptExecution failed with a nonzero exit code

Cause 1 of 3

The Podfile or Podfile.lock changed and pod install was not run

1Check

The diff shows pods with versions in one file and not the other.

diff Podfile.lock Pods/Manifest.lock

2Fix

Run pod install. It installs the versions recorded in Podfile.lock, which is what the team shares. Do not use pod update here, it ignores the lockfile and moves versions.

pod install

3Verify

The diff is empty and the build passes.

diff Podfile.lock Pods/Manifest.lock && echo in sync

Confirmed by guides.cocoapods.org

Did this fix it?

Cause 2 of 3

CI or a fresh clone builds without installing pods

1Check

If Pods/ is in .gitignore and the pipeline has no install step, Pods/Manifest.lock does not exist and the comparison fails.

git check-ignore -v Pods
ls Pods/Manifest.lock

2Fix

Add pod install before the build step, or commit the Pods folder. CocoaPods supports either choice, but Podfile and Podfile.lock must always be committed.

pod install
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp build

3Verify

The build phase passes in CI.

ls Podfile.lock Pods/Manifest.lock

Confirmed by guides.cocoapods.org

Did this fix it?

Cause 3 of 3

The lockfile is not committed, or pod install ran in the wrong folder

1Check

The build phase reads Podfile.lock from the Podfile directory. If the lockfile is untracked, each machine creates its own.

git ls-files Podfile.lock
find . -name Podfile.lock -not -path './Pods/*'

2Fix

Run pod install in the folder that holds the Podfile, then commit Podfile.lock.

cd path/to/podfile-folder
pod install
git add Podfile.lock

3Verify

git shows Podfile.lock tracked, and the diff is empty.

diff Podfile.lock Pods/Manifest.lock && echo in sync

Confirmed by guides.cocoapods.org

Did this fix it?

How do I stop it coming back?

  • Always commit Podfile and Podfile.lock.
  • Make pod install the first step after git pull in your team's checklist, and the step before every CI build.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.