358

I've encountered an strange issue after installing RestKit with cocoapods. after resolving RestKit dependency for my project with cocoapods and trying to build it, I face this error:

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

I tried running pod install, but no change.

Here are some shots: enter image description here

enter image description here

  PODS:
  - AFNetworking (1.3.3)
  - RestKit (0.20.3):
    - RestKit/Core
  - RestKit/Core (0.20.3):
    - RestKit/CoreData
    - RestKit/Network
    - RestKit/ObjectMapping
  - RestKit/CoreData (0.20.3)
  - RestKit/Network (0.20.3):
    - AFNetworking (~> 1.3.0)
    - RestKit/ObjectMapping
    - RestKit/Support
    - SOCKit
  - RestKit/ObjectMapping (0.20.3)
  - RestKit/Search (0.20.3):
    - RestKit/CoreData
  - RestKit/Support (0.20.3):
    - TransitionKit (= 1.1.1)
  - RestKit/Testing (0.20.3)
  - SOCKit (1.1)
  - TransitionKit (1.1.1)

DEPENDENCIES:
  - RestKit (~> 0.20.0)
  - RestKit/Search (~> 0.20.0)
  - RestKit/Testing (~> 0.20.0)

SPEC CHECKSUMS:
  AFNetworking: 61fdd49e2ffe6380378df37b3b6e70630bb9dd66
  RestKit: 1f181c180105a92f11ec4f6cd7de37625e516d83
  SOCKit: 2f3bc4d07910de12dcc202815e07db68a3802581
  TransitionKit: d0e3344aac92991395d4c2e72d9c5a8ceeb12910

COCOAPODS: 0.29.0
Hashem Aboonajmi
  • 13,077
  • 8
  • 66
  • 75

58 Answers58

415

I was able to fix that by updating CocoaPods.

I. Project Cleanup

  1. In the project navigator, select your project
  2. Select your target
  3. Remove all libPods*.a in Build Phases > Link Binary With Libraries

II. Update CocoaPods

  1. Launch Terminal and go to your project directory.
  2. Update CocoaPods using the command pod install
CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
Mr. Fahrenheit
  • 4,206
  • 1
  • 13
  • 3
  • 1
    When I run the pod install command in the project directory I received below warning: The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile: source 'https://github.com/CocoaPods/Specs.git' I also added this link in the pod file but same thing happened. please suggest. – Mitesh Khatri Oct 22 '14 at 06:09
  • In addition to this I had to remove all CocoaPod related build phases such as 'Check Pods Manifest.lock' and 'Copy Pods Resources'. – JVillella Dec 19 '14 at 19:52
  • Usually the issue happens because of this: https://github.com/CocoaPods/CocoaPods/issues/1822 – KarenAnne Apr 14 '15 at 07:08
  • [!] No `Podfile' found in the project directory. getting this message in terminal – Jayprakash Dubey Aug 10 '15 at 10:03
  • 21
    @ Valery Pavlov These steps worked but after a successful project clean, the build fails immediately with the same 3 errors I cant seem to get rid of below. I tried fully removing all cocoapods, reinstalling, updating, doing all of this with xcode restarts and etc. All of these in terminal perform successfully but the build continues to fail. Any further thoughts? Errors: 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. – natur3 Aug 25 '15 at 06:58
  • would be useful to have more clarity on step 1 and 3 ie what headings its under – UKDataGeek Dec 23 '15 at 11:34
  • 1
    I tried Pod install..But i got error like this You have either: * out-of-date source repos which you can update with `pod repo update`. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile. Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default. – IKKA Jun 07 '16 at 12:37
  • @Mr. Fahrenheit, for me pod update works, are you sure that point 2.Update CocoaPods using the command pod install is correct, or you should update the command in your ans – Vijay Yadav Oct 08 '16 at 11:47
  • In my case, this work when uninstalling react-native package as well. – The1993 Feb 13 '20 at 01:47
  • Hi, I tried everything from the answers of you and others, but I'm still getting the same error. My project is created form `cordova`. Is there any special care to be take from `cordova`, please let me know. – Harsha Jul 07 '20 at 09:12
  • @JVillella you should not remove that script from the build phase. See [here](https://stackoverflow.com/a/65783259/5175709) . That script is there to make sure you're snapsho of all dependencies is in sync with the snapshot of your repo. Or perhaps after you remove it, it gets added again – mfaani Jan 18 '21 at 23:19
  • I am confused. The OP said he ran pod install, and your solution is to run pod install? – Scorb Mar 02 '21 at 20:38
  • I resolved thad only by these commands in terminal: 1) cd ios 2) pod install . After that I selected 'Clean Build Folder' from 'Product' menu and everything goes OK. – M Karimi Feb 22 '22 at 11:58
136

After many attemps I managed to fix this problem. Variable ${PODS_ROOT} was not set and I do below trick. Go to Build Phases -> Check Pods Manifest.lock and replace

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

to

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

It helps me.

Carlos P
  • 3,928
  • 2
  • 34
  • 50
Pavel Shorokhov
  • 4,485
  • 1
  • 35
  • 44
86

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

In my case, method 1 works.

Method 1:

  1. choose the target > go to Build Phases > 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

fredpi
  • 8,414
  • 5
  • 41
  • 61
Eddie
  • 1,011
  • 7
  • 8
47

If you remove all pods from your target in the Podfile, e.g.

target 'myTarget' do
pod 'great-stuff', '~> 4.0'  // you deleted this last pod
end

you'll need to manually delete these builds steps from your Xcode target Build Phases:

  • Check Pods Manifest.lock
  • Copy Pod resources

Cocoapods (current stable version 0.37.2) does not perform this cleanup when you run pod install.

100grams
  • 3,502
  • 3
  • 30
  • 27
  • This worked for me. Id been migrating to swift 2 and had commented out all pods - i just turned one of the pods back on rather than messing with deleting build phases. – brian.clear Sep 30 '15 at 17:23
  • bingo! i spent hours removing my workspace, reinstalling pods, etc and nothing else worked. – Oren Oct 29 '15 at 04:04
41

Removing pods from the project and re-installing worked for me.

There is nice GitHub repository that can completely remove the pods from the project.

Just keep the backup of your PodFile and run below commands.

  • gem install cocoapods-deintegrate
  • gem install cocoapods-clean
  • Go to the project directory and run pod deintegrate
  • Again run pod clean
  • Run pod install

Clean and run.

Teena nath Paul
  • 2,219
  • 23
  • 28
  • 1
    You are great, only yours worked for me, thanks a lot – albert sh Jul 26 '17 at 19:34
  • After running these commands I get a successful build message, but now, nothing appears to run on the simulator nor the console. Do you know why this happened? – Jorge Barrios Aug 21 '17 at 02:39
  • BE AWARE: Build works, but the pod clean dissapeared the project target. No archives were generated nor app builded. – Ruben Feb 07 '19 at 19:32
  • @Ruben the disappeared content will regenerate on "pod install" again – Teena nath Paul Feb 08 '19 at 09:25
  • Despite that, after doing the steps you mentioned my app icon don't appear anymore as the main project... Only the cordova logo appears, and no build or archive is being generated. – Ruben Feb 11 '19 at 23:25
  • Its worked for me, I update my Xcode 12.3 and try to run flutter project I am not able after I did your steps its worked again Thanks – mottu Dec 31 '20 at 04:05
  • This solution worked for me, albeit it was not necessary to run “pod clean”. – Vitor Nov 18 '21 at 16:49
  • Note: This still works in 2022 – Thiago Silva Mar 14 '22 at 21:13
18

If you are seeing an error like the following:

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.

Then there's a problem with Cocoapods in your project. Sometimes cocoapods can get out of sync and you need to re-initiate cocoapods. You should be able to resolve this error by:

  1. Deleting the Podfile.lock file in your project folder
  2. Deleting the Pods folder in your project folder
  3. Execute 'pod install' in your project folder
  4. Do a "Clean" in Xcode
  5. Rebuild your project
David
  • 1,365
  • 14
  • 23
13

After changing target name

My problem was xcconfig with old target names.

  • Went to project file -> info -> configuration
  • Removed old xcconfig (both Debug & Release)
  • pod install

It would update to new ones.

Also if you had missing .h files that's the reason (pods header search path is in these xcconfig)

Avishay Cohen
  • 2,418
  • 1
  • 22
  • 40
  • Choosing `None` worked for me as well. I was struggling with this for a day trying to integrate the Gimbal2 SDK into an Ionic4 project. – Russ Oct 25 '18 at 17:47
10

I found my solution: Run:pod update instead of pod install. The error was fixed!

giapnh
  • 2,950
  • 24
  • 20
10
  • Go to Build Phases -> Check Pods Manifest.lock
  • Replace
${PODS_ROOT}/Manifest.lock

with:

${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock

Check in image :

enter image description here

xiawi
  • 1,772
  • 4
  • 19
  • 21
The_PratikshaK
  • 121
  • 1
  • 7
  • This worked for me in a Cordova iOS build, while the accepted answer did not work. – Bastian Blankenburg Nov 08 '19 at 10:14
  • Thank you for pointing out the origin of the error, but this also didn't solve my issue. Ideally Cordova do not recommend modifying their pod file, but if we delete the Podfile.lock and do a pod install again with the modified Podfile , there should not be an error. So, as a last option I commented the if condition, since I feel it is not a necessary check, and thus I came out of the issue. – Shihab Mar 09 '21 at 14:52
10

First you have to understand what the Podfile.lock is then understand what the Manifest.lock is and where it's used.

The Podfile holds either the (optimistic or exact) versions of every dependency you have. The lock file holds only exact versions.

Once you do pod install all the pods get downloaded/installed into the /pods directory. You may want to commit them Or maybe not. That's up to your team. What's NOT up to your team is decide if they should commit the the Podfile.lock or not. That needs to be committed so every dev in the team can be sure they've got the exact same version.

  • So let's say you downloaded your team’s code. In your project's root directory you only have Podfile and Podfile.lock and the Pods directory wasn’t committed.
  • Then you do pod install to creat the Pods directory. Your snapshot of every pods’ version should match with the versions of all pods from the Podfile.lock.
  • CocoaPods has a safety check in place, to ensure matching versions

This is where the Manifest.lock comes into play. Manifest.lock is your local machine's lock created. It has to match with Podfile.lock that is generated by the last commit (that caused changes in for your pods) in your repo. If it doesn't match then something is messed up.

Docs on what the Manifest.lock file is:

  #     Manifest.lock: A file contained in the Pods folder that keeps track of
  #     the pods installed in the local machine. This files is used once the
  #     exact versions of the Pods has been computed to detect if that version
  #     is already installed. This file is not intended to be kept under source
  #     control and is a copy of the Podfile.lock.

I honestly can only think of one scenario in which the Manifest.lock and Podfile.lock would be out of sync:

I mean if you pull from main branch, then you get main's Podfile and lock file. If you then make a change to the Podfile and then run pod install, then you would be updating the Podfile.lock and Manifest.lock and will keep them in sync. No issues with this

Is this just so that if:

  1. You and your team don’t commit the /Pods directory
  2. You have merge conflicts in your Podfile or Podfile.lock but don’t realize it. Or you haven't committed both Podfile and Podfile.lock
  3. Then given that Xcode doesn’t process the Podfile and Podfile.lock, then naturally your project can build successfully.
  4. However if you go in an inspect your Build Phases of your targets you'd see the following

enter image description here

That script is documented here

#     Adds a shell script build phase responsible for checking if the Pods
#     locked in the Pods/Manifest.lock file are in sync with the Pods defined
#     in the Podfile.lock.
#     
#     @note   The build phase is appended to the front because to fail fast.
#     
#     @return [void]

What those lines do are: perform a diff and ensure that sure your Manifest.lock i.e. your local snapshot of all installed pod versions are equal to Podfile.lock i.e. your repo's current snapshot of all installed pod versions.

The fix is likely super simple, just make sure you Podfile is what you want. Then just run pod install. You have also somehow accidentally made changes to your Manifest.lock inside your /Pods directory (or as mentioned earlier maybe only committed the lock file but not the Podfile or vice versa). Deleting /Pods directory causes no harm. Just do a pod install after. Do not do pod update unless that's what you want.

Just make sure you never delete the Podfile.lock otherwise if you do pod install then it would update all dependencies to the latest version it can.


Also helpful to see and this video on lock files, CocoaPods docs on how the lock file is put to use differently for pod install vs. pod update and last see how all that logic is used in more detail this artsy blog on checksums. It's worth noting that a single space will create a new checksum and can make things out of sync.

mfaani
  • 33,269
  • 19
  • 164
  • 293
  • Did all of that didn't help. Pretty sure the test itself is buggy and produces a false failure. Not the first time I came across a sanity check which fails unnecessarily. There is a reason why I program sanity checks as **WARNINGS** and not as errors. – Martin Mar 03 '21 at 10:31
  • @Martin I'm skeptical if you're correct. However if you're 100% sure, you can remove the check from your project's build phase – mfaani Apr 03 '22 at 14:30
7

Can you try this:

  1. Delete the Pods folder
  2. Delete Podfile.lock
  3. Run pod install
  4. Clean + Build
6

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

target 'MyProject WatchKit App' do
    platform :watchos, '2.0'
    shared_pods
end

target 'MyProject WatchKit App Extension' do
    platform :watchos, '2.0'
    shared_pods
end

PS: Maybe this happened for me because I mistakenly installed pods for MyProject WatchKit App target initially.

Shyngys Kassymov
  • 718
  • 11
  • 21
6

Try to set up the correct target in Podfile and then run pod update or pod install

ios platform target

tyoc213
  • 1,223
  • 18
  • 21
5

Run this, and your errors will vanish

rm -rf Pods && gem install cocoapods && pod install

Siraj Alam
  • 9,217
  • 9
  • 53
  • 65
4

I encountered this issue with a misconfigured xcconfig file.

The Pods-generated xcconfig was not correctly #included in the customise xcconfig that I was using. This caused $PODS_ROOT to not be set resulting in the failure of diff "/../Podfile.lock" "/Manifest.lock", for obvious reasons, which Pods misinterprets as a sync issue.

Mensly
  • 81
  • 4
4

For me the problem was that I made a new target in my app by duplicating an existing one, but forgot to add the target to the Podfile. For some reason, the cloned target did work for days without problems, but after a while it failed to build by this error. I had to create a new target entry for my cloned project target in the Podfile then run pod install.

gklka
  • 2,459
  • 1
  • 26
  • 53
4

If you download the project from github or copy from other place, then the dependencies library do not exists, there will be this issue.

You just need to cd to the project/project_name directory in terminal , use ls to check whether there is a Podfile file.

if there exists the Podfile, you just need to install the dependencyies:

pod install
aircraft
  • 25,146
  • 28
  • 91
  • 166
  • Thanks - this really helped me a lot when I was running the flutter examples downloaded from their github website and I had received the same error. I navigated to the ios folder for each flutter example folder and did the pod install and then the flutter app worked. – Simon Apr 13 '18 at 09:12
  • glad to help you. – aircraft Apr 13 '18 at 09:45
4

My working answer is:

  1. Install update your cocoapods by this command: pod update
  2. Install your new pods by this command. pod install
  3. Last one command: sudo gem install cocoapods.
Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
Gurpreet Singh
  • 803
  • 9
  • 16
3

The steps that worked for me (XCode 8.3.3/XCode 9 beta with a Swift 3.1 project)

 - Navigate to your project directory
 - pod install //which then asks you to do the next step
 - pod repo update //takes a while to update the repo
 - pod update
 - pod install
 - Close Xcode session
 - Open and Clean the project
 - Build/Run

Also make sure you open the .xcworkspace file rather than the project file (.xcodeproj) when working with pods. That should solve any errors with linking such as "Apple Mach -O Linker command failed"

Naishta
  • 11,885
  • 4
  • 72
  • 54
3

Please do the following steps:

1: Deleting the Podfile.lock file in your project folder

2: Deleting the Pods folder in your project folder

3: Execute 'pod install' in your project folder

4: Do a "Clean" in Xcode

5: Rebuild your project

IKKA
  • 6,297
  • 7
  • 50
  • 88
3

I tried everything, but the problem persisted. After that I did this and it worked ASAP (As Smooth As Possible).

  1. Open the .xcworkspace file.
  2. Change to legacy build system if using Cordova on Xcode 10.
  3. Go to target/project of Podfile. Select Deployment traget as 11+
  4. Then Change the debug and release to Pods-.build/release. It was App.debug/release in my case.Pic attached. Hope it helps. CHange the Debug Release in Pod
jolly
  • 3,353
  • 1
  • 15
  • 21
3

Completely nothing worked out for me from these answers. Had to create the project again by running cordova platform add ios. What I've noticed, even freshly generated project with (in my case) Firebase pods caused the error message over and over again. In my opinion looks like a bug for some (Firebase, RestKit) pods in Xcode or CocoaPods. To have the pods included I could simply edit my config.xml and run cordova platform add iOS, which did everything for me automatically. Not sure if it will work in all scenarios though.

Edit: I had a Podfile from previous iOS/Xcode, but the newest as of today have # DO NOT MODIFY -- auto-generated by Apache Cordova in the Podfile. This turned on a light in my head to try the approach. Looks a bit trivial, but works and my Firebase features worked out.

Daniel Danielecki
  • 8,508
  • 6
  • 68
  • 94
  • 1
    This is the only method that worked for me. Tried all others. I deleted platforms and did a reinstall of 'cordova platform add ios'. I too think I had a previous platforms/ios which I used on a previous version of xcode. – Heath Jun 23 '20 at 21:04
3

Check Pods target and Runner target thats have to be same

1- Runner

enter image description here

2- Pods

enter image description here

Eray Hamurlu
  • 657
  • 7
  • 9
2

This made my day!

  1. Deleting the Podfile.lock file in your project folder
  2. Deleting the Pods folder in your project folder
  3. Execute pod install in your project folder
  4. Do a "Clean" in Xcode
  5. Rebuild your project
Rao
  • 20,781
  • 11
  • 57
  • 77
alitosuner
  • 984
  • 1
  • 10
  • 15
2

For me, working in flutter, the configuration was not automatically added due the existing configuration.

Adding #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig" to Flutter/Release.xcconfig and Flutter/Debug.xcconfig

solved the issue.

tomerpacific
  • 4,704
  • 13
  • 34
  • 52
2

Be sure the pod configuration files are set.

enter image description here

Muhammed Tanriverdi
  • 3,230
  • 1
  • 23
  • 24
1

When you do

pod install --verbose

make sure:

1- you are in the correct directory. Most times, when a github project is downloaded, there will be a master folder. You need to be inside the actual project name folder(masterfolder/project folder) in the terminal before you invoke pod install --verbose

2- Delete the old pod lock folder then clean the project using xcode clean & do pod install.

3- Keep your rvm updated.

Gokhan Dilek
  • 4,314
  • 4
  • 21
  • 24
1

My problem was the cocoa pods version so I installed the latest with: sudo gem install cocoapods --pre Then pod update

That worked for me

DariusV
  • 2,645
  • 16
  • 21
1

If you are applying to the way Project Cleanup and your project still error.

You can go to tab Build Phases and then Find Check Pods Manifest.lock and remove the script.

Then type command to remove folder Pods like that rm -rf Pods

and then you need to remove Podfile.lock by command rm Podfile.lock

Probably, base on a situation you can remove file your_project_name.xcworkspace

Finally, you need the command to install Pod pod install --repo-update.

Hopefully, this solution comes up with you. Happy coding :)

Cuong Nguyen
  • 980
  • 2
  • 9
  • 29
  • @JVillella you should not remove that script from the build phase. See [here](https://stackoverflow.com/a/65783259/5175709) . That script is there to make sure you're snapsho of all dependencies is in sync with the snapshot of your repo. Or perhaps after you remove it, it gets added again – mfaani Jan 18 '21 at 23:23
1

I had same error. First I update cocoapods using

sudo gem install cocoapods

then install pods using Pod install command worked for me.

Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58
1

I faced this problem in a Flutter project. I just opened iOS Module in xCode and Build Clean Folder worked for me.

Developine
  • 12,483
  • 8
  • 38
  • 42
1

I had the same issue with Ionic-3, I did some above mention steps but none of them worked for me.

For Ionic Remove the ios platform

$ ionic cordova platform remove ios
$ ionic cordova platform add ios

Open xcode then try to build. this worked for me :-)

Rajat.r2
  • 137
  • 2
  • 13
1

Fixed my issue with ionic app by installing cordova version 9, tried all above solution mostly linked with xcode neither worked for my ionic app

If anyone facing same issue with their cordova app kindly update to cordova 9 to fix this

Vikrant Satpute
  • 123
  • 1
  • 5
1

This can also happen if you use Windows for the Git checkout, and the Podfile.lock is created with windows (CRLF) line endings.

keccs
  • 153
  • 1
  • 6
1

Following the answer of Mr. Fahrenheit what helped me to solve the problem on mac m1, instead of pod install was to run:

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

instead of pod install

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32715414) – James Risner Sep 20 '22 at 12:29
0

if your pods are empty

  1. remove copy pods resources and check pods manifest.
  2. lock from build phases settings of your project
Tunaki
  • 132,869
  • 46
  • 340
  • 423
0

My problem was when my fellow developer added a pod in the project and then i pull the project using github then the error occurred. I ran pod install and it updated the pods with new library which was added by my fellow developer. hope it helps.

0

I have the same problem with latest ComponentKit 0.14. The reason is PODS_ROOT was not set and i have found the solution is add a line to ComponentKit.xcconfig :

#include "../Pods/Target Support Files/Pods-ComponentKit/Pods-ComponentKit.debug.xcconfig"
0

Check in your project that Pods are maybe not being pushed to Git. So it's obvious that compile will break since it cannot find the Pods directory

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

I solved this by issuing pod install in the Terminal after navigating to my project's directory.

Indeed, I had an error cannot find pod command which meant that cocoapods were not installed. This is fixed via gem install cocoapods. If you get any dependency error, just install each command that is reported missing. In my case I had to update Ruby and after that cocoapods were installed properly and I was able to use the command pod install.

PS. If you have Pods directory, try pod update. Maybe your library needs updating.

sandalone
  • 41,141
  • 63
  • 222
  • 338
0

i had this issue when i was trying to remove previously installed library

@Michal's answer helped me

Remove or uninstall library previously added : cocoapods

Community
  • 1
  • 1
0

I accidentally removed and then unpack back folder from where I tried to install pod.
It was like this: 1) cd in your project folder 2) zip your project 3) remove project folder 4) unzip folder back 5) from now even you have this folder you should go to this folder again from the terminal

Nikolay Shubenkov
  • 3,133
  • 1
  • 29
  • 31
0

I had error:

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.

I pulled request from bitbucket for first time. I cleaned my project and tried everything(pod install, pod update etc.) but none of the above answer worked for me. Then I just check the path where I was installing the pod and corrected it and installed again,It just worked. Make sure give the path just before where .xcodeproj or .xcworkspace(if it is already there)exist. May be someone get benefitted from this.

0

I use the cocoa pods installation from the bundle.

  • Install bundler
  • Add Gemfile in root of project
  • Add required gems in Gemfile
  • bundle install
  • and then always use bundle exec pod install

If you don't know how-tos of one of these steps, searching on google will help :)

Jasveer Singh
  • 354
  • 3
  • 10
0
pod deintegrate <PROJECT>.XCODEPROJ // will deintegrate cocoapods
pod install // installs the pods
Sravan
  • 591
  • 1
  • 4
  • 16
0

I had the same issue I update everything to the latest from: npm -v 6.4.1 node -v v10.2.1 pod --version 1.5.3

to: npm -v 6.5.0 node -v v11.8.0 pod --version 1.6.0

and fix it

  • 2
    Welcome to SO, you could take the tour [here](https://stackoverflow.com/tour) and your answers will be always appreciated. Even though your answer might be relevant, its a bit confusing as per how you guessed the mentioned versions as there is not any specific comment on that. Also your answer is not quite helpful as its missing the actual root cause you faced, plus your environment details and which steps you executed to fix the issue. – AntJavaDev Feb 06 '19 at 18:07
0

I got this error when I added a new developer account. I changed the Team under project name but I missed to update it under the Pods folder.

I solved it once I updated the new developer ID under the Teams option available under Pods-> Signing -> Team, the error was gone and the build succeeded.

drops
  • 1,524
  • 1
  • 11
  • 20
sbanerjee
  • 1
  • 1
0

I mixed up some comments above and that resolved my problem

I. Project Cleanup

  1. In the project navigator, select your project
  2. Select your target
  3. Remove all libPods*.a in Build Phases > Link Binary With Libraries

II. Clean build folder

In XCode: Menu Bar → Product → Product -> Clean build Folder

III. Update cocapods

Run pod update

phuongtm
  • 379
  • 3
  • 9
0

For me it was an issue with the Ruby version number.

I was getting the error:

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

After trying a million things, including much of what is included in this thread I wound up hacking the pod file located at: usr/local/bin/pod

I corrected the first line to point to the ruby version that actually existed on my machine. I changed:

#!/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby

to

#!/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby

After days of struggling, changing a 3 to a 6 fixed everything.

Raseone
  • 9
  • 1
0

I tried all sorts of combinations of pod install, deleting node_modules & reinstalling, cleaning & rebuilding the xcode project, and even restarting my computer. None of these worked for me...

The fix for me was running pod --version in my project's root directory. I don't know how or why, but this successfully installed a missing dependency, so I thought I'd share it here in case it helps someone else :)

Blundering Philosopher
  • 6,245
  • 2
  • 43
  • 59
0

I was able to fix this by clicking Product->Clean Build Folder.

enter image description here

faraza
  • 416
  • 9
  • 21
0

These simple steps work for me:

  1. close your workspace
  2. run pod install --repo-update
  3. open your workspace, rebuild (It will be more reasonable, if you clean up your build folder).
Neal.Marlin
  • 494
  • 5
  • 17
0

In my case, this problem was due to a corrupt *.xcworkspace file. It was showing two different versions of my project in the Project Navigator menu on the left.

To verify, I removed the output redirection ( > /dev/null) from the bash script located in Build Phases > Check Pods Manifest.lock, so that it would print the diff to STDOUT. Sure enough, reading the build log, I had wildly different Podfile.lock and Manifest.lock output.

To fix it I deleted my *.xcworkspace, then ran pod install again from my ios folder. That autoregenerates the workspace file. Open that new file in XCode and voila, no more build errors.

JP Lew
  • 4,121
  • 2
  • 32
  • 45
0

I solved by running pod install and copying the content of file Pods/Manifest.lock to the file Podfile.lock

ahmed S
  • 336
  • 3
  • 12
0

We had the same issue, someone in our team had opened the Podfile.lock in Visual Studio Code, saved it, and the editor had removed the CR (carriage return) at the end of the file. Reintroducing the 'CR' solved the problem. So definitely run that command to figure out why those files are different.

diff "${PODS_ROOT}/../../Podfile.lock" "${PODS_ROOT}/Manifest.lock"
0

Remove Pods.framework in:

Folder named Pods Linked Frameworks and Libraries And delete all new inputed lines from @main file App for ios

0

This helped me. Hope it helps you

remove

import 'dart:html'; unused

Mr N
  • 25
  • 1
  • 3
0

I fix this issue by following these steps:

  1. Flutter clean.
  2. Delete the Podfile.lock and pods.
  3. Update CocoaPods using the command.
  4. cd ios and run pod install.

Then simply flutter pub get and run

Haseeb Zafar
  • 1
  • 1
  • 2
-1

You need to include Pods-generated xcconfig path in your customized xcconfig. For me this was due to that misconfigured xcconfig file.