how to install pod without disturbing previous pods? - ios

I am using Xcode 10.3, If I install one pod,It is installing but previous pods are updating.Tell me way to install pod without updating remaining pods.

You can set exact version to old pods like pod 'IQKeyboardManagerSwift', '3.0'. You can list versions of current pods using cat Podfile.lock.

It should be sufficient to run pod install. Unlike pod update, it will read the Podfile.lock to keep existing Pods at the same version.

Related

Swift app downloaded from source control doesn't run on my machine, runs on coworkers

The bounty expires in 3 days. Answers to this question are eligible for a +50 reputation bounty.
Oscar A Garcia wants to draw more attention to this question.
A coworker and I are taking over an iOS app hosted on GitLab. This app utilizes cocoapods, and the Pods directory is included in the repo. My understanding is we should be able to pull the repo and run it on Xcode without issues.
My coworker is able to download the app from source control and run it on his machine. Mine is getting errors such as "Cannot find type 'AnimationView' in scope". He is running an M1 MacBook, I'm running an intel-based MacBook air. I'm opening the workspace file that was generated by CocoaPods, not xcodepro.
Here's a list of things I've tried:
Regenerating the pods via the command line by running pod reintegrate, then pod update, opening Xcode and cleaning the build folder, and then running again.
Changing the minimum iOS deployment target on Xcode to the highest deployment target of the pods in my podfile.
Changing the architectures on the app build settings to i386 and x86_64 rather than the default.
Clicking "Update to recommended settings" when Pods throws a warning.
None of these seem to work, I'm at a loss at this point. Since it runs on my coworker's machine I'm assuming there must be something wrong with how my app is detecting the libraries or how it's compiling.
Here's my podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'projectname' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for projectname
pod 'Purchases'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'SwiftyJSON'
pod 'CleanyModal'
pod 'MagicTimer'
pod 'lottie-ios'
pod 'FBSDKCoreKit'
end
I suspect the problem is not related to pods.
The reason for this is if you start a fresh iOS Xcode project, called emptyproj, and then close the iOS project in Xcode, you can then go to that project directory and place in a Podfile into that directory with your above contents but with the name projectname replaced with emptyproj, you can then do
pod install
and then once it has created emptyproj.xcworksapce open it in Xcode.
You will notice that there is no symbol called AnimationView. There is only LottieAnimationView.
So the missing symbol must be in the actual app on GitLab, not the pod dependencies.
What I suggest is to look at any build phases in the build of the project to see if any scripts that are architecture-specific get run.
Another debugging strategy is to get your co-worker onto your machine and do the setup herself on your machine, which might succeed (an unmentioned step) or fail (stronger evidence that it is a machine or architecture related matter).
This looks like you have different version of lootie , ask your coworker to check version he is currently using
for this you can use command:
pod outdated
When you run pod outdated, CocoaPods will list all pods that have newer versions that the ones listed in the Podfile.lock
then
use pod with specyfic version like this:
pod 'lottie-ios', '3.5.0'
instead of:
pod 'lottie-ios'
If you didn't add version when you run 'pod install' you will get newest available version.
and AnimationView is part of lottie liblary.
After adding version number run 'pod install'.
In such a case you can ask for the Podfile.lock of your co-worker and can check for the already installed specific version of the relevant pod, and if there any mismatch with there installed version with yours, update your pod file by adding that version and then pod install. and also if you guys don't need to work with latest version of the pods it is always better to use pod with versions.

I have deleted a Pod from Pods Library but still it's showing this error and not running

I have deleted RoundCornerProgress Pods from Pods library in Xcode but after that when I run the project it shows this error. How can I resolve this problem?
Try using pod install --no-repo-update command.
Remove the pod that you don't need from your pod file and then run this command.
This command will essentially remove the unwanted libraries without affecting other dependencies. Clean and build your project after doing this and it should work fine.
Use pod deintegrate to remove all traces of CocoaPods from the Xcode project.

How to keep changes I did in the Pod dependencies after I do cocoapods install again?

I had to do some local changes to some frameworks I am using. However, I installed them with cocoapods. Is there any way to keep those changes when I do pod install again for new dependencies ?
Thanks for the ask question.
I am sorry to say this is not possible because when you have install or Update your pod then replace all file from new file.
pod outdated:
When you run pod outdated, CocoaPods will list all pods which have newer versions than the ones listed in the Podfile.lock (the versions currently installed for each pod). This means that if you run pod update PODNAME on those pods, they will be updated — as long as the new version still matches the restrictions like pod 'MyPod', '~>x.y' set in your Podfile.
pod update:
When you run pod update PODNAME, CocoaPods will try to find an updated version of the pod PODNAME, without taking into account the version listed in Podfile.lock. It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile).
If you run pod update with no pod name, CocoaPods will update every pod listed in your Podfile to the latest version possible.
You can also find reference from here.
You have to create a folk on git, of that libraries in which you are doing changes localy, and use that commit url instead of library name and version in pod file.
Whenever you are going to update lib, you will get your code.
This is solve your problem. :)

Cocoapods downgrades dependencies

Somehow every time I run pod install or pod update, my project dependencies are downgraded.
And if I explicitly write the project version, the pod install does not work.
Running the same pod file on another computer works fine.
Here is my pod file and my command line screen.
The solution was to use.
$ pod setup

Exclude a pod from updating

I use Cocoapods. I have made some changes to a 3rd party library and if I run pod update, all those changes would get replaced. Running pod install does the same thing.
Is there a way to exclude a pod from updating? Or a way to install a single pod without affecting others?
At last Found the Solution.
It will install pod without any repository update if you already have the library in the project,else will download
pod install --no-repo-update
If you want to update specific libraries you can use :
pod update [POD_NAME...]
I know this topic is pretty old but someone might come here after an answer, so here it is:
from https://github.com/CocoaPods/CocoaPods/pull/7524
--exclude-pods option to pod update command.
It allows to skip the update operation for specific pods.
Yes, just specify the version you want to install, like if you want to keep using AFNetworking 1.3 and not upgrade to 2.*:
pod 'AFNetworking', '~> 1.3.2'
Please check this discussion:
https://github.com/CocoaPods/CocoaPods/issues/760
One possible solution for now to update only a single pod would be:
Remove specific pod from Podfile
pod install
Re-add specific pod to Podfile
pod install

Resources