I was using a pod file in my previous iOS project which I want to include in my new project as well. But it has been deprecated and I am unable to include it using pod install in terminal. How to do it?
Edit1: Is there a way to manually include a pod from an existing project instead of "pod installing" it?
If you want to install deprecated pods, just include the version of that pod when you declare it in the Podfile.
For example, in order to install version 2.6.3 of AFNetworking via Cocoapods, here's how you would declare it in the Podfile:
pod ‘AFNetworking’, ‘2.6.3’
Doing a pod install installs it correctly.
The Podfile.lock file holds the version of the pods you were using, so if you have the Podfile and Podfile.lock, you can make a pod install and it should install the same pods.
Related
I have been using the fb sdk from a while,
i pod file I add
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
and then use pod install
and it automatically install the latest version of pod
But what I'm seeing actually is the installed version is [] is 6.5.11
but the release facebook sdk version is
is not installing a pd without to the specific version mentioned in pod file, installs the latest version automatically ?
if you want to check The Podfile.lock it keeps track of the resolved versions of each Pod installed.
pod update & Pod Install
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.
understand the pod install vs. pod update
Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
Use pod update [PODNAME] only when you want to update pods to a newer version.
so try with pod update instead of pod install
I am trying to install 2 pod files without affecting/updating other dependencies in my pod file.
I tried with pod install --no-repo-update command. It is not working.
I want to install Fabric pod file when I try to install other dependencies are also updating and I don't want it because some dependencies are deprecated and it will show some warning and error, this is I don't want so I am trying to install pod without affecting and updating other pod files.
Here is the screenshot, in xcode I am getting 197 warnings. Before the installation of pod file there were 6 Xcode warnings.
pod 'Fabric'
pod 'Crashlytics'
You cannot install specific pod but you update specific pod.
Reference
https://guides.cocoapods.org/using/pod-install-vs-update.html
Pod install
Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
Pod Update
Use pod update [PODNAME] only when you want to update pods to a newer versio
To install new pod without updating others, just open up the existing file and add your pod file below the existing pods.
Now, go to terminal and open up your project and run command:
$ pod install
Note: This way, it will only add new pod without updating your existing pods.
I'm trying to install Firebase via CocoaPods for my Objective-C iOS Application. My Podfile is as follows:
target 'RandomName' do
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
When I run pod install, I get the following error:
[!] Unable to satisfy the following requirements:
- `Firebase/Core` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`.
You have either:
* out-of-date source repos which you can update with `pod repo update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
The latest version of CocoaPods is installed, and I have tried running pod repo update. Having a Podfile of the following works fine, but when I try to #import Firebase; in my AppDelegate.m file, Xcode cannot find the module.
target 'RandomName' do
pod 'Firebase'
end
However, the following combination does not install:
target 'RandomName' do
pod 'Firebase'
pod 'Firebase/AdMob'
end
Any help would be appreciated!
Check what version of Firebase is installed when you use pod 'Firebase'. For me it installs 2.4.3 which is an old version. The docs say that the pod should install 3.2 using that pod. It explains why the other pods don't work as they are part of Firebase 3. Pod update doesn't update Firebase to the latest version either. Even forcing a version doesn't work. It can't seem to find the new Firebase versions even though they are in the same podspec.
Here is how I solved it:
make sure you have the latest version of git installed
make sure you have cocoapods >= 1.0.0 installed
delete your pods repo (run pod repo remove master) and use pod setup to make a new one
use the following in your pod file
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Core'
(use whatever you want, just don't use 'Firebase')
pod install
everything should install properly
Running 'pod repo remove master' to remove the Pods repo //removes the library
Running 'pod setup' //clones the updated git repo for specs which takes long time as its size is beyond 300K (Be patient!)
Running 'pod install' //problem is solved
have you tried to add
frameworks
use_frameworks!
after target 'RandomName' line
and adding
platform :ios, '9.0'
before target ....
A couple of items to try. From your question, you did try the first two items, but leaving here for completeness of my answer.
The error response you get is helpful. Follow the steps for pod repo update
Make sure your pod is up to date.
pwd> pod --version
1.0.0
Make certain that your git is up to date. I had a build machine that had an outdated git (1.7), and I had the same exact error
-
When I updated to this version from git 1.7 it worked fine.
pwd> git --version
git version 2.8.1
My Podfile for using Firebase Dynamic Links
run pod init from the folder where your .xcodeproj is
Be sure to only launch the .xcworkspace instead of the .xcodeproj from here out.
platform :ios, '8.0'
use_frameworks!
target 'the-name-of-target' do
pod 'Firebase/DynamicLinks'
end
The Same problem occurred while on pod install command.
Please relaunch terminal and navigate to your Xcode project then
simply fire same pod install command. 'Firebase/Database' will installed successfully :)
I just doing following step to fix this error:
$pod setup -- verbose
Then do $pod install
that works for me and my pod file is:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'the-name-of-target' do
pod 'Eureka', '~> 1.6'
end
UPDATE:
Then you can remove your master and re-install cocoapods using following code:
cd ~/.cocoapods/repos
rm -rf master
pod setup
I had the same error, and my solution was to downgrade Cocoapods to 1.0.0, because Cocoapods 1.0.1 didn't work as I expected. Everything works great now!
sudo gem uninstall cocoapods -v 1.0.1
sudo gem install cocoapods -v 1.0.0
My Podfile:
platform :ios, '8.0'
target 'XXX' do
pod 'Firebase/Auth'
pod 'Firebase/Database'
end
For people still having problems with this. When directly coping the firebase walkthourgh website, the install string is:
pod `Firebase/Core`
While it should have been:
pod 'Firebase/Core'
No need for pod setup if this applies to you too.
Update Git and Cocoapods to the last version:
Git: $ brew update && brew upgrade
Cocoapods: $ pod repo update
I want to install specific dependency using cocoapods. if I execute pod install, other dependencies are updating before installing my newly added dependency. I just want to install specific pod without touching other dependencies. And I know deleting, updating any dependency also updates others. Is there any way to solve this problem?
Actually my problem is when I myself modify some dependency and run pod install it reverts back to its original version. But I don't want to lose my changes
Any suggestion will be appreciated.
Make sure that Podfile.lock is in the same folder as Podfile is.
Add a line in the Podfile
pod 'MBProgressHUD','~> 0.9'
cd to your project and use the following line in the Terminal, it'll install just the above pod you specified.
pod install podName
From official website here's the link!
Running pod install will install the current version of RestKit, causing a Podfile.lock to be generated that indicates the exact version installed (e.g. RestKit 0.10.3). Thanks to the Podfile.lock, running pod install on this hypothetical project at a later point in time on a different machine will still install RestKit 0.10.3 even if a newer version is available. CocoaPods will honour the Pod version in Podfile.lock unless the dependency is updated in the Podfile or pod update is called (which will cause a new Podfile.lock to be generated). In this way CocoaPods avoids headaches caused by unexpected changes to dependencies.
I am trying set up Stripe in my IOS app, but i have no clue what these instructions mean?
Is cocoapods an application i install?
Step 1: Install Stripe Cocapod(s)
CocoaPods is a common library dependency management tool for iOS
development. To use the Stripe CocoaPods, simply add the following to
your Podfile and run pod install:
pod 'Stripe'
pod 'PaymentKit'
Note: be sure to use the .xcworkspace to
open your project in Xcode instead of the .xcproject.
Here is the guide i am using to set up Stripe... Guide
CocoaPods is a dependency manager.
Install CocoaPods. sudo gem install cocoapods. You may need to pod setup afterwards.
Go into your project directory and pod init. This will generate a Podfile.
Go ahead and edit the Podfile with your favourite editor (vim, emacs, flame wars...). Enter pod 'Stripe' in one line under your target, and also enter pod 'PaymentKit' in a second line. This will install these two frameworks and their dependencies.
Run pod install for CocoaPods to magically install the required dependencies.
Open your $project.xcworkspace. The workspace includes your project as well as your pods target which generates the necessary frameworks.
You're done! Enjoy Stripe and PaymentKit!
cocoa pod installation step :
Open Your Terminal :
sudo gem update --system
sudo gem install cocoapods
pod setup
Then Go To Your Project Directory
pod init
open -a Xcode Podfile
[Edit POD file with pod ‘libname’ ]
pod install