Somoy Das Gupta
Somoy Das Gupta

Reputation: 1974

could not find compatible versions for pod

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.

Upvotes: 75

Views: 89830

Answers (14)

Sanjay Bharwani
Sanjay Bharwani

Reputation: 4739

I am new to iOS and mobile development and was facing this error.

The below command worked, not exactly sure which piece fixed the problem (as there are different commands)

I had tried few of them independently to no luck. But post this command the project build perfectly fine, so its going to my cheatsheet.

cd ios/ && 
pod deintegrate || true && 
pod cache clean --all || true &&
rm -rf Pods || true && 
rm Podfile.lock || true &&  
pod install --repo-update || true  

Upvotes: 0

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

Upvotes: 2

Shourob Datta
Shourob Datta

Reputation: 2072

In .podfile

changed the iOS version

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

It worked

Upvotes: 11

SardorbekR
SardorbekR

Reputation: 1758

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

Upvotes: 5

Erald
Erald

Reputation: 21

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

pod install

and it will be fixed

Upvotes: 0

Kingsley Akpan
Kingsley Akpan

Reputation: 273

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

platform :ios, '11.0'

Upvotes: 7

Ravi Panchal
Ravi Panchal

Reputation: 1355

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.

Upvotes: 76

Ankur Lahiry
Ankur Lahiry

Reputation: 2315

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.

Upvotes: 0

vikas prajapati
vikas prajapati

Reputation: 1946

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

platform :ios, '9.0'

Upvotes: 1

Jerome Li
Jerome Li

Reputation: 1576

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.

Upvotes: 30

Ankur Lahiry
Ankur Lahiry

Reputation: 2315

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

Solution:

pod install --repo-update

Upvotes: 38

Giang
Giang

Reputation: 3635

I fixed by a change to dynamic pod version.

And delete file Podfile.lock

enter image description here

Upvotes: 1

landonandrey
landonandrey

Reputation: 1341

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

Upvotes: 53

Himanth
Himanth

Reputation: 2421

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.

Upvotes: 2

Related Questions