could not find compatible versions for pod - ios

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.

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.

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

if #Ravi Panchal's answer can't solve your problem, it may be your pod repo is out dated
Solution:
pod install --repo-update

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.

please check your podfile and update the platform to the appropriate version number
platform :ios, '11.0'

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

In .podfile
changed the iOS version
platform :ios, '13.0' // Warning change by your desired
It worked

I had the same issue with FIRMessaging from cocoapods. I solved the issue by doing like following steps
Remove FTPopOverMenu from your podfile which can find in your project folder.
Open terminal and run pod install. You can see in terminal that FTPopOverMenu will be removing from your pods.
Now, again open your podfile and write this pod 'FTPopOverMenu'. Run pod install in terminal.
The error will go away from terminal.

if you are facing this error in Flutter CocoaPods could not find compatible versions for pod
increase your minimum deployments
cd ios and then rm -rf Pods/ Podfile.lock ; pod install
flutter build ios

I fixed by a change to dynamic pod version.
And delete file Podfile.lock

Please check the line below in your Podfile. Please make sure it is commented. it works for me.
platform :ios, '9.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.

Look at the iOS Deployment Target, make it 11.0 and then do
pod install
and it will be fixed

Related

Pod Install remove/delete some unrelated object/property

I'd like to remove a Pod called EvernoteSDK from my project.
I remove the pod by execute these steps:
Remove 'EvernoteSDK' from Podfile
Run pod install
Result:
The EvernoteSDK has been removed. But when I check the diff, It deletes some object/property in some xcconfig file that I think it should be not related to the removed Pod. And this change is occurred in all installed Pod of my project. The diff result is shown in the image below:
Issue Image
My environment:
xCode 12
I tried it by using Cocoapods 1.9.3
Why is it happened? And how to remove a pod without affect other Pod file?
Because this is my first time to face this issue when removing a Pod.
Thank you.
It's up to version of Cocoapods. That difference is probably some new config from Cocoapods, so everything should be alright.

Could not build module 'nanopb' error in Xcode 12.0.1

I upgraded my Xcode to 12. Everything was working perfectly and all of a sudden I kept getting bellow error message (Image below)
SO link have tried using to solve this issue
SO Link
What I've done so far
Cleaned Build Folder
Restarted Xcode
Updated Cocoapods
Deleted DerivedData
Cleared pod cache
Deleted pods directory and file and reinstall
None of them worked and its getting frustrating.
Pod file
All I did was to follow the instruction(see image below) and it got fixed.
Source here
I had the same problem with a project still targeting iOS 8 as the minimum iOS version. This steps solved my problem:
Update minimum target iOS version to iOS 9 on Podfile file;
Open terminal on project folder, remove all pod file dependencies and update them by running:
rm -rf /Pods
pod repo update
pod install
Update minimum project target iOS version to iOS 9;
Remove DerivedData;
Clean project;
Compile/run project again.
A simpler solution is to update cocoapods to the 1.10 version
First, update the CocoaPods installation :
[sudo] gem install cocoapods
Then, update your project : bundle update cocoapods
Finally, run pod install and everything should be OK :)
If the previous solutions did not help someone, then try changing it this way:
#include <nanopb/pb.h>
->
#include "nanopb/pb.h"
This issue CAN be the result of developing iOS on an M1 (Apple Silicon) machine. In this case, the only way to fix the problem is to download a Ruby extension called "ffi" which you can read about here (for extra information): https://rubygems.org/gems/ffi/versions/1.0.9
To do this:
In Terminal, install ffi onto your machine using this command:
sudo arch -x86_64 gem install ffi
Then in your project file, install your podfile with this command:
arch -x86_64 pod install
This should allow you to install your pods (especially if you were getting a "zsh: abort pod install" problem. Notice Terminal will warn you "a bug in the Ruby interpreter or extension libraries".
After this, if your pod was FireStore/FireBase you may have to get another GoogleService-Info.plist file in your project.

Xcode 10 build fails with 'Command CompileSwift failed with a nonzero exit code

I updated Xcode to version 10 recently and started to receive a strange error when trying to build my project. I'm currently on Swift 4.0 and I did try to upgrade to swift Version 4.2. But when I did I received this same error in many of my frameworks.
Command Compile Swift failed with a nonzero exit code
So far I've deleted the derived folder. Updated all pods, also deleted all pods and reinstalled them using the terminal commands below.
sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod clean
pod install
This didn't work to fix my issue. However, I found something that could work which was adding arm64 architecture in Build Setting -> valid architectures and enabling automatic code But, when I checked it was already there and code signing was enabled already.
Additionally, I do have a few other build errors that have to do with frameworks.
SwiftMessages
Value of type 'SwiftMessages.Config' has no member 'presentationContext'
WhatsNewKit
Missing argument for parameter 'backgroundColor' in call`
I opened issues with the developers of each of these frameworks to seek help with these issues.
Issue On SwiftMessage GitHub
Issue On WhatsNewKit GitHub
When I click presentationContext it brings me to the struct within the SwiftMessages Framework. Usually, when I've had the "has no member" warning I cannot click to see the original place where it exists.
I assume this has something to do with cocoa pods, but haven't been able to find a solution yet. What can I do to correct this issue? If anyone could help would be deeply appreciated been stuck on this for a day now.
Update:
The two frameworks latest builds were for swift 4.2. When I changed the version of each framework to one that was built in swift 4.0 I got the project to build.
Make sure that, your project Swift Language Version is in the proper version. SwiftMessages 6.0.0 works with Swift 4.2.
I solved this way:
Comment all pods in your .pod file
From your terminal, run the command pod install --no-repo-update
Open Xcode perform a clean and rebuild the project
Now open your .pod file and uncomment the first library
From your terminal, run the command pod install
Repeat steps 2 - 3 - 4 -5 for each uncomment library in your .pod file
I hope it can be of your help.
Make sure that, Your project build settings Optimization Level is in No Optimization[-Onone].
for pod SwiftMessages if your app is not swift 4.2 you need to user the version 5.01
pod 'SwiftMessages', '~> 5.0.1'
and it will work like a charm
Set Swift version to 4.2 then pod deintegrate, pod install, fix this problem for me. Thanks #alejandro-iván
Good Morning!
Do a clean. using"commond + shift + k
Close Xcode.
Navigate to project directory where the Podfile exist.
Do pod update/pod install
Open x.xcworkspace
This error happened to me when I used same class name in two different groups. Then I renamed one of the classes and the problem was solved
All of the answers were helpful to me. In my case, I only install frameworks manually but this kind of problem also happens. I tried all of the answers and was still getting this issue during the build. Curiously, while coding, I could cmd-click and resolve all of the "missing" components. I also cleaned and deleted derived data, restarted Xcode, etc.
I eventually got it working by inducing these additional steps:
On each of the framework project/targets (including my own):
Verify consistent Swift version (4.2 in my case)
Set Build for Active Architecture Only to No
Set Valid Architecture to arm64, armv7 (to match with base project)
Set Optimization Level to None (for Debug)
Set Compilation Mode to Whole
I had several frameworks (homegrown) plus my app. Somehow they ended up being out of sync as far as the Swift version. Make sure that all frameworks are the same version. In my case, they all needed to be set to Swift 4.2. If you haven't done the migration to 4.2 then remember that Xcode helps with this: Edit -> Convert -> To Current Swift Syntax.
only for re-install pod using that command pod install
see below attachment
In my case I connect an actual iphone not simulator and run the app once on it, It solved the problem. But connect iphone firstly, then choose it from this menu, then press run button.
The problem will solve too.
I stumbled upon this problem when upgrading to Xcode 10.2 and Swift 5. After trying everything I found this in the release notes:
The Swift compiler may crash during a build when the Thread Sanitizer
is enabled. (48719789)
And sure enough, efter turning off Thread Sanitizer my project could be compiled without errors again.
So if you get this error and have Thread Sanitizer enabled - turn it off!
Same issue happened to me in Xcode 10.2, it was a Xcode bug..!
So, I opened in older Xcode version(9.4), and it worked fine. Then I updated to the Xcode 10.2.1 after it's release -> Clean and build your project, now my problem solved.
I'm having the same problem, my Xcode version is 10.2.1 (10E1001),
Cocoapods version is 1.7.0.beta.2.
I returned to Cocoapods 1.6.1 and the problem was solved.
The specific steps are:
pod deintegrate to cancel the integration.
Uninstall all Cocoapods.
for i in $( gem list --local --no-version | grep cocoapods );
do
gem uninstall $i;
done
Install the stable version of Cocoapods. For now it's 1.6.1.
gem install cocoapods
Clean Project and empty DerivedData⁩
pod install
Recompile the project
In my case it was a code error:
self.myDto.map{ (dto)} in
var stringValue = (dto.value(forKey: "name") as! String)
stringValue.append("c")
return stringValue
}
Just removed that stringValue variable fixed the problem.
I just had the same error message and none of the answers here and in the duplicates of this question were applicable to my project or helpful.
I kept on reading through the error messages and came to a realisation that I had stupidly named two seperate swift files in different folders with the same name intending to change one, but before I got to change one, I tried to run my project and have been annoyed for the last hour.
Bottom line, don't accidentally name your files the same name and read your error codes thoroughly!
target 'XYZ' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for xyz
pod 'SwiftyJSON'
pod 'Localize-Swift'
pod 'Alamofire'
pod 'Kingfisher'
pod 'Tabman'
pod 'RSSelectionMenu'
pod 'Pushbots'
pod 'ACProgressHUD-Swift', '~> 1.4'
pod 'SKPhotoBrowser'
pod 'ZoomableImageSlider'
pod 'RSSelectionMenu'
pod 'DropDown'
pod 'ImagePicker'
end
I updated platform :ios, '10.0' to 11.0 and the error disappeared. Change your platform or OS version and check. Hope that could help.
Specify your pod's version for example pod 'RealmSwift', '~> 5.3.5'
or uncomment # platform :ios, '9.0' in your Podfile
I faced this issue on Xcode 14. Add this on podfile bottom.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# some older pods don't support some architectures, anything over iOS 11 resolves that
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end

cocoapods don't generate workspace

I'm quite New to ios and cocoapods.
I am using realm.io swift version. Everything is latest version including xcode, realm and cocoapods
I did it with dynamic linking and realised itunes don't accept the strips framework.sh ...so I try using cocoapods. I didn't remove the dynamic linking and followed the steps using cocoapods to install realm.
It generated the workspace file for me and the running keeps telling realm object can't be found though I have import realm.
So I decided to remove the previous dynamic linking and install cocoapods to start all over again.
Now cocoapods don't generate workspace for me.even a new project that I created.
I tried all the comments to remove pod, cocoapod and even clone the cocoapods etc but nothing works
Please help. Why it don't generate workspace for me anymore
I followed these steps but still don't work
https://teamtreehouse.com/forum/pod-install-error-in-terminal-not-creating-xcode-workspace
Just copying from the comments: the answer was to specify use_frameworks! to the test target.
I was getting an Abort:6 error during the Generating Pods project step of pod install.
I deleted the Pods folder, reinstalled Cocoapods, ran pod install again, and it worked.
Reinstall cocoapods:
sudo gem uninstall cocoapods
sudo gem install cocoapods
I used all of the given solution and get success.
First got to Product->Scheme->ManageScheme and then check the shared box(Selected Form)
now pod install
if problem still arise
Try this
pod setup
pod install
if still have problem.(this worked for me)
rm -rf ~/.cocoapods
pod setup
pod install
if problem still there then last but not least
rm -rf ~/.cocoapods
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod install
If you've done all the above steps and if it's still not working, try
pod install --repo-update
I tried all the above steps, and still it was generating pod folders with blank dependency names. This step should download all the required dependencies for your project and will also create the .xcworkspace
To generate a workspace you must have the installer line in your Podfile saying:
integrate_targets => true
like this:
install! 'cocoapods', :integrate_targets => true
If you are using frameworks you do not need the workspace generated.
Try adding
use_frameworks!
between the platform line and the target line, then redo pod install from your terminal.
I did
rm -rf ~/.cocoapods/repos/trunk/
After that it worked again.

Cannot compile Cocoapods with XCode/Obj-C – "Pods-prefix.pch.dia: No such file or directory"

I am using XCode 4.5.1 and iOS 6.0 base SDK.
Here is the error I am receiving:
i686-apple-darwin11-llvm-gcc-4.2: /Users/fahim/Library/Developer/Xcode/DerivedData/Currenthiphop-emodxxwwaiojlcboaxuodksuwuww/Build/Intermediates/PrecompiledHeaders/Pods-prefix-evibdktwbatdnbabmrlnderfsxxi/Pods-prefix.pch.dia: No such file or directory
There is only 1 file in the Pods-prefix-xxx directory:
Pods-prefix.pch.pth.hash-criteria
Here is my Podfile:
platform :ios
pod 'LibComponentLogging-Core'
pod 'LibComponentLogging-LogFile'
pod 'LibComponentLogging-qlog'
pod 'LibComponentLogging-pods'
pod 'Facebook-iOS-SDK'
pod 'RestKit'
Any help is appreciated. Thank you!
I actually found this solution right here that details opening up Xcode using normal means (Finder or the Dock), as opposed to using the open <Workspace>.xcworkspace command. I've always used Xcode from my dock, whereas the other developer (who couldn't build the project and was getting the error you were) was using the open command from the command line. Once he opened Xcode from the Dock, and manually browsed to open the project that way, he could build it successfully.
If you are using CocoaPods 0.18.0, this might be cause by CocoaPods and is fixed in https://github.com/CocoaPods/CocoaPods/issues/956
Extra quote in "$(inherited)" was the cause (https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/generator/xcconfig.rb#L150). It should not be quoted. If you remove them from the xcconfig the project will build again. You may want to check your xcconfig and see if there are extra quote.
This issue can be caused by a few different factors but in my case and the case of some colleagues, this resolved the missing pch.dia
Uninstall CocoaPods and install 0.17.1
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 0.17.1 --verbose
Lock your Kiwi version to 2.05 if Kiwi is one of your pods:
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi', '2.0.5'
Clean your Xcode project including Derived Data. Close down Xcode, re-open the project and build.

Resources