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

22

26

I have got the following errors after trying multiple answers from the google.

PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/apple/Library/Developer/Xcode/DerivedData/Build/Intermediates/FoodSpot.build/Debug-
    iphonesimulator/FoodSpotTests.build/Script-36819C3C1B6A30F50091382D.sh
        cd "/Users/apple/Downloads/FoodSpot 2"
        /bin/sh -c /Users/apple/Library/Developer/Xcode/DerivedData/Build/Intermediates/FoodSpot.build/Debug-iphonesimulator/FoodSpotTests.build/Script-36819C3C1B6A30F50091382D.sh

    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.

I have updated and installed many times, but they are of no use.

Zoometry answered 31/7, 2015 at 4:56 Comment(0)
B
18

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

Breath answered 31/7, 2015 at 5:16 Comment(2)
clean and build the projectBreath
For future seekers: Clean and build are both located under the "Product" tab of the main menu.Hemingway
R
46

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

Refuge answered 4/11, 2017 at 5:32 Comment(7)
This is the proper solution to the problem.Quezada
This was my situation also. I found that "pod deintegrate" and then running "pod install" added these settings back in for me so that I didn't need to set these myself explicitly.Santinasantini
I tried before with different solutions but this one is the most accurate. I tried the other solutions I was doing without understanding but now I understand.Incorporator
'PODS_ROOT = ${SRCROOT}/Pods' isn't a valid name for a build setting. The first character should be a letter or an underscore, and the remaining characters should be letters, underscores, or numbers. I am receiving this error though I think its a valid nameOverwrite
Perfect solution.Spanishamerican
Where do I set "User-Defined variables" in the "Build Settings" ? I have no such group under my Build Settings in Xcode (12.5).Heir
That is not true - I do have a "User-Defined " section - I just can't use the Search at the top of Build Settings to find it for some reason. So to get to User-Defined I scroll to the bottom of Build Settings - OR, I can use the little + button at the top to add a new one. Unfortunately this doesn't fully fix my build as I'm now facing "Runner-Bridging-Header.h:1:9: 'GeneratedPluginRegistrant.h' file not found"Heir
W
33

For me, it works after the following:

pod deintegrate --verbose    
pod install --verbose
Worst answered 17/2, 2016 at 2:28 Comment(0)
B
18

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

Breath answered 31/7, 2015 at 5:16 Comment(2)
clean and build the projectBreath
For future seekers: Clean and build are both located under the "Product" tab of the main menu.Hemingway
C
15

I had been searching for hours and I found solutions as follow:

In my case, method 3 works.

Method 1:

  1. choose the target > go to Build Phrases > click Link Binary With Libraries > remove all libPods.a files
  2. open Terminal > direct to your project > run:

     pod install
    
  3. clean and build project

ref.1

Method 2:

  1. open Terminal > direct to your project > run:

    pod deintegrate --verbose    
    pod install --verbose
    

ref.2

Method 3:

  1. choose the target > go to Build Settings > click "+" sign
  2. add 2 User-Defined Settings: [to the left = to the right]

    PODS_ROOT = ${SRCROOT}/Pods
    

    and

    PODS_PODFILE_DIR_PATH = ${SRCROOT}/
    

ref.3

Corri answered 13/12, 2018 at 5:20 Comment(0)
S
5

Just go to Build phases and click on [CP]check Pods Manifest.lock.

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

Both PODS_PODFILE_DIR_PATH and POD_ROOT should define in user-Defined in build settings. POD_ROOT should have correct path to Manifext.lock file and POD_PODFILE_DIR_PATH should have correct path for Podfile.lock

So Add below in build settings.

PODS_ROOT ---- ${SRCROOT}/Pods

PODS_PODFILE_DIR_PATH ---- ${SRCROOT}
Spectrogram answered 24/10, 2017 at 22:3 Comment(0)
R
3

The problem is Podfile.lock and Manifest.lock cannot be found by the Check Pods Manifest.lock Script in your targets build phase.

enter image description here

This is usually caused by PODS_PODFILE_DIR_PATH and PODS_ROOT variables not being defined.

Go to build settings tab to define them.

enter image description here

You will need to look for Podfile.lock and Manifest.lock in your project and get the the full paths of their directories. The directory paths will be the values you use for PODS_PODFILE_DIR_PATH and PODS_ROOT.

Rahr answered 2/10, 2018 at 22:19 Comment(1)
Yes, I got the same issue it got fixed by ur answer.Arciform
H
3

Edit

It turned out my issue was due to a new line at the end of the Manifest.lock that was not present in the PodFile.lock file. Running a diff on the two files highlighted the issue.

Adding a new line to the end of the PodFile.lock file solved it.

Original Answer

None of the answers have worked for me so I have just checked the "For install builds only" under "[CP] Check Pods Manifest. lock" which is found in the build phases tab.

I believe this setting means it will only run that check when archiving, allowing me to continue developing as I don't need to archive the app on my machine.

Use with caution though as it may not be the best solution for everyone.

[CP] Check Pods Manifest.lock

Highpressure answered 17/6, 2021 at 13:4 Comment(0)
E
2

Deleting the derived data did the trick for me . I deleted by going into the finder itself.

Eaglewood answered 14/4, 2016 at 13:10 Comment(0)
D
2

Make changes in the podfile as given below:

Older pod file

target :TargetName, :exclusive => true do

Changed pod file

target 'TargetName' do

Dibbuk answered 8/6, 2016 at 8:13 Comment(0)
E
2

I'm pretty sure that you have opened your Projects' workspace which you try to install new Pods. So try out the following (for me this worked):

  1. Clean the project
  2. Close the project
  3. Run pod install
  4. Open the project and try re-building it once more

Problem might have been resolved.

Eckert answered 21/7, 2016 at 9:11 Comment(0)
D
1

Make sure you add a "pod install" command line build step, before the Xcode Project build step.

The error is coming from the build phase run script in your Xcode project's target, which is unable to find Podfile.lock. This file is generated by CocoaPods, which must be installed in a build step in your TeamCity project.

My build steps look like:

  1. Command line: bundle install --path .bundle (installs cocoapods local to the project using Gemfile).
  2. Command line: bundle exec pod install --verbose (uses Podfile)
  3. Command line: carthage update --platform iOS (uses Cartfile)
  4. Xcode Project
  5. Command line to build an archive
  6. Command line to upload a build

Hope this helps.

Discriminative answered 15/4, 2016 at 18:50 Comment(0)
O
1

In my case, I got same error after integrating my other targets. To solve problem I needed to add both targets in Podfile:

abstract_target 'myApp' do
   use_frameworks!

   pod 'Alamofire', '~> 3.0'
   pod 'SwiftyJSON'

    target 'myAppOtherTarget'
end
Opah answered 6/10, 2016 at 13:8 Comment(0)
O
1

This happens if cocoa pods don't install or uninstall properly

If you want to install cocoa pods run

pod install

if you you want to uninstall cocoa pods then run command

pod deintegrate
Offwhite answered 27/4, 2017 at 11:13 Comment(0)
U
1

I had the same issue. Turned out the cocoapods version on Manifest.lock was higher than what I had on my mac. I had to do a 'sudo gem install cocoapods', to get the version of the cocoapods upto what was specified on the Manifest.lock file. This fixed the issue and I had no errors on building the project.

Unbind answered 4/7, 2017 at 1:56 Comment(0)
P
1

Im facing the same issue now and fixed using this command after navigating to project location in terminal.

pod install --repo-update
Perugia answered 18/9, 2017 at 13:52 Comment(0)
M
1

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

PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
Mckale answered 1/9, 2018 at 12:33 Comment(0)
B
0

In my case, the errors were occurring on a _Tests target. I didn't need the _Tests target, and so I deleted it. This resolved the error.

Barajas answered 6/7, 2016 at 4:31 Comment(0)
I
0

If you happen to move your Podfile like i did and face this issue, the solution discussed below may help -

  1. Delete all of the following - Pods folder, xcworkspace file, podlock file (skip the ones that are not available for subfolders)
  2. delete all steps that has [cp] in it from the build phase tab
  3. repeat step 1 & 2 for all the sub projects that you have in your workspace
  4. open workspace, go into each project and delete framework for pods, and delete the pods folder from each project
  5. close workspace
  6. run pod install

you should now be able to open, build and run the project

Inweave answered 6/12, 2017 at 20:1 Comment(0)
P
0

I just fixed it by updating the Cocoapod, cause before the error there was log where the warning shows we need to upgrade our cocoapods as the pod files are not supported by the current cocoapod version, So clean the project , upgrade cocoapod then install pod.

1. Clean project
2. sudo gem install cocoapods/gem install cocoapods
3. pod install (optional if your project still shows error)

Note: I found this error for my flutter application in iOS platform

Pride answered 16/8, 2019 at 11:14 Comment(0)
C
0

I think you are trying to use your old project pod folder in your current project, you have to copy Manifest.lock file of your current project and replace that file in your old project's pod folder which you added. Manifest.lock file location YourProject->Pods->Manifest.lock Hope This was helpful. worked for me!

Cima answered 15/2, 2020 at 6:24 Comment(0)
F
0

Please check Top Sites - Sandbox Sync iOS for more explanation. I fixed the issue by changing file paths from

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

to

diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null

in Xocde -> "Open Your Project" -> "Select Your Project" -> "Select Your Target" -> Build Phases -> Check Pods Manifest.lock

If not, try changing paths as mentioned above, along with Legacy Build System. To change build system Xcode -> File -> Workspace Settings -> Build System -> Legacy Build System

Fording answered 8/7, 2020 at 9:42 Comment(0)
H
-1

I hate to say this, but I just removed the pods/ or didn't include them in the project and it built. I don't know if this will have a long-term effect on the project though.

This is presently my .sh build script for ionic5 for ios. It will probably change in the future.

# BUILDING FOR IOS

##################################
#
#     MAKE SURE YOU UNPLUG ALL DEVICES!!!!!
#
##################################

 
ionic cordova platform remove ios
ionic cordova prepare ios 
ionic cordova platform add ios
ionic cordova build ios --prod --release --buildFlag="-UseModernBuildSystem=0" --verbose
cd platforms
cd ios
open "MyApp.xcworkspace/"
cd ..
cd ..

It had be plaguing my project, so I thought I'd take them out. I am yet to deploy the project so far though... so who knows. BigSur 11.1, XCode 12.4 (12D4e)

Hanlon answered 6/2, 2021 at 1:54 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.