66

I am new in IOS development and git. I am having a problem after merging my local repo to the dev repo. After merging when I build the project I get an error in the Xcode that says, "The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation."

Build Error

I searched about this and tried the usual solution reinstalling the pods. But executing

pod install

I get another error in terminal that says

Terminal Error

At this point I tried deleting the files associated with the "FTPopOverMenu" pod and reinstalling with pod install. The error doesn't go away. Also, I tried solving it in this way - Error:“The sandbox is not in sync with the Podfile.lock…” after installing RestKit with cocoapods

But both error in the Xcode and in the terminal still remains. I'm new to IOS and Git. I really don't understand what is really happening here.

Somoy Das Gupta
  • 1,874
  • 1
  • 16
  • 19
  • have you define a version for FTPopOverMenu in your pod file so check it(pod 'FTPopOverMenu', '~> 1.3') if it is not match with cocoa pod version or else try this "pod deintegrate" and "pod install" and "pod update" if any issue so let me know – Ravi Panchal Feb 06 '18 at 08:02
  • 1
    I did the first-bit _try this `pod deintegrate` and `pod install`_ but the same error came up when I executed the `pod install`. I don't know what happened but the `pod update` fixed it. After deintigrating the `pod update` installed all the pods. No more pod error though. Thanks, man. – Somoy Das Gupta Feb 06 '18 at 10:12
  • your problem resolved ? or not – Ravi Panchal Feb 06 '18 at 11:13
  • resolved. Thanks. :D – Somoy Das Gupta Feb 06 '18 at 13:22
  • as per my guess you are working on an old project means which is already developed in Xcode 8 series and now you are working with latest Xcode and you have updated the code accordingly. and can i post my answer so it might help to other user ? – Ravi Panchal Feb 07 '18 at 05:20
  • your guess is right. post your answer. – Somoy Das Gupta Feb 07 '18 at 05:47

13 Answers13

69

As per my guess you are working on an old project means which is already developed in Xcode 8 series and now you are working with latest Xcode and you have updated the code accordingly.

So just do the below steps:

  1. "pod deintegrate"
  2. "pod install"
  3. "pod update" (if it is necessary so do it else if you have all latest pod so don't use it.)

It will remove all old cocoapods traces.

OR Alternate way to do it (Temp Work Around)

  • Remove that cocoa pod temporary, after all your work finish add to your project and give a try cause in my case it is the only work around i have that worked.
Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
Ravi Panchal
  • 1,285
  • 10
  • 22
47

In my case pod repos were outdated, solved with pod repo update

landonandrey
  • 1,271
  • 1
  • 16
  • 26
36

if @Ravi Panchal's answer can't solve your problem, it may be your pod repo is out dated

Solution:

pod install --repo-update
Ankur Lahiry
  • 2,253
  • 1
  • 15
  • 25
25

First, check your Podfile.lock and make sure no conflict with the spec constraints.

I encounter this issue with strange pod dependency, and solve it by

1. remove Podfile.lock

2. pod install again

It just work like magic. I think it is a bug that cocoapods cannot solve this kind of constraints in Podfile.lock. Remove the old Podfile.lock can make it apply the new rule easily.

Jerome Li
  • 1,492
  • 14
  • 20
8

In .podfile

changed the iOS version

platform :ios, '13.0' // Warning change by your desired

It worked

Shourob Datta
  • 1,886
  • 22
  • 30
5

In my case it worked after I changed iOS version from 8.0 to 9.0 in Target (not Project) settings >> General >> Deployment Info

enter image description here

mfaani
  • 33,269
  • 19
  • 164
  • 293
SardorbekR
  • 1,388
  • 3
  • 18
  • 33
5

please check your podfile and update the platform to the appropriate version number

platform :ios, '11.0'

Kingsley Akpan
  • 213
  • 3
  • 3
2

I had the same issue with FIRMessaging from cocoapods. I solved the issue by doing like following steps

  1. Remove FTPopOverMenu from your podfile which can find in your project folder.
  2. Open terminal and run pod install. You can see in terminal that FTPopOverMenu will be removing from your pods.
  3. Now, again open your podfile and write this pod 'FTPopOverMenu'. Run pod install in terminal.

The error will go away from terminal.

Himanth
  • 2,381
  • 3
  • 28
  • 41
  • I followed the solution @ravi.p gave. I tried to solve it in this way, but every time I did `pod install` the same error occurred. – Somoy Das Gupta Feb 06 '18 at 10:16
  • have you removed FTPopOverMenu from your podfile before installing – Himanth Feb 06 '18 at 11:23
  • yes. But [the error](https://i.stack.imgur.com/GhsGH.png) was still there. `pod deintegrate` removed all cocoapods traces. Then `pod update` installed everything again. `pod install` didn't work. I have had a similar problem with **JVFloatLabeledTextField** and I removed the JVFloatLabeledTextField Folder from the Pods in my project navigator and uninstalled it with `pod install`. But this time `pod install` was showing the same error. Even after doing deintegrate. – Somoy Das Gupta Feb 06 '18 at 13:30
1

I fixed by a change to dynamic pod version.

And delete file Podfile.lock

enter image description here

Giang
  • 3,553
  • 30
  • 28
1

if you are facing this error in Flutter CocoaPods could not find compatible versions for pod

  1. increase your minimum deployments
  2. cd ios and then rm -rf Pods/ Podfile.lock ; pod install
  3. flutter build ios

enter image description here

0

Please check the line below in your Podfile. Please make sure it is commented. it works for me.

platform :ios, '9.0'
ChamCham
  • 484
  • 1
  • 8
  • 19
vikas prajapati
  • 1,868
  • 2
  • 18
  • 26
0

I have an answer regarding this in the thread already. But this time my scenario was different. My co-worker accidentally updated the cocoa version from the stable to a beta version, while I was using the lower stable version. I wasn't interested using the beta version, so I didn't update.

As deleting podfile.lock is dangerous which leads to removing the Cocoapods traces, I just opened podfile.lock in editors like Sublime Text, and downgraded the pod which is causing the problem.

Ankur Lahiry
  • 2,253
  • 1
  • 15
  • 25
0

Look at the iOS Deployment Target, make it 11.0 and then do

pod install

and it will be fixed

m4n0
  • 29,823
  • 27
  • 76
  • 89
Erald
  • 21
  • 3