问题
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.
回答1:
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:-
- "pod deintegrate"
- "pod install"
- "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.
回答2:
In my case pod repos were outdated, solved with pod repo update
回答3:
if @Ravi Panchal's answer can't solve your problem, it may be your pod repo is out dated
Solution:
pod install --repo-update
回答4:
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.
回答5:
I had the same issue with FIRMessaging
from cocoapods
. I solved the issue by doing like following steps
- Remove
FTPopOverMenu
from yourpodfile
which can find in your project folder. - Open terminal and run
pod install
. You can see in terminal thatFTPopOverMenu
will be removing from your pods. - Now, again open your
podfile
and write thispod 'FTPopOverMenu'
. Runpod install
in terminal.
The error will go away from terminal.
回答6:
I fixed by a change to dynamic pod version.
And delete file Podfile.lock
回答7:
In my case it worked after I changed iOS version from 8.0 to 9.0 in Runner.xcworkspace
来源:https://stackoverflow.com/questions/48638059/could-not-find-compatible-versions-for-pod