Currently attempting to set up Stripe in a fresh iOS app in Swift using the following guide: https://stripe.com/docs/mobile/ios. Immediately ran into trouble with Cocoapods. The repo can be found here: https://github.com/ktransier/stripeTest/blob/master/Podfile
First attempted using the line:
pod 'Stripe'
This resulted in:
Analyzing dependencies
Downloading dependencies
Installing PaymentKit (1.0.2)
Installing Stripe (1.0.2)
Generating Pods project
Integrating client project
I need version 2.2.1 (the latest version), but it is installing 1.0.2.
Next I attempted to use the explicit version number, as copied off the Cocoapods site:
pod 'Stripe', '~> 2.2'
Terminal output:
[!] Unable to satisfy the following requirements:
- `Stripe (~> 2.2)` required by `Podfile`
Here's my stack:
CocoaPods : 0.34.4
Ruby : ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.1]
RubyGems : 2.4.1
Host : Mac OS X 10.10 (14A389)
Xcode : 6.1 (6A1052d)
Git : git version 1.9.3 (Apple Git-50)
How can I install the latest Stripe library?
Looks like your local copy of the specs repo hasn't been updated in a while. Try running
pod repo update
Related
I want to use OpenCV from a pod in a subspec on a framework that I'm working on and that requires adding a prefix header file. Since Cocoapods provides a property named prefix_header_file that should be trivial. But the problem I have is that what happens is that cocoapods appends the content of the provided file after some default content. This does not work because the opencv headers needs to be included before the objective c parts.
I have tried to add a post_install to the subspec but that does not seem to get executed (not mentioned in the docs so probably dropped support for that) and I have looked at the script_phase but that only executes on build time I think. I dont want the users of the framework to have to add some post_install to their Podfiles. Someone must have had this issue before?
Stack
CocoaPods : 1.6.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
RubyGems : 3.0.6
Host : Mac OS X 10.15.3 (19D76)
Xcode : 11.3.1 (11C504)
Git : git version 2.21.1 (Apple Git-122.3)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git # 20c4d13a7bbfb4a1871705bc38fe0266eed3841a
trunk - # fatal: not a git repository (or any of the parent directories): .git
Installation Source
Executable Path: /usr/local/bin/pod
Plugins
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.4.1
cocoapods-try : 1.1.0
As of now with latest Cocoapods being v1.9 it is not possible
https://github.com/CocoaPods/CocoaPods/issues/9625
I tried to install swiftSoup to parse HTML to my xCode project but unfortunately version of swiftSoup installed by command expressed in official site
is 1.4 which is unacceptable to work with swift 4.0. I found out that version of swiftSoup compatible with xCode 9 and swift 4.0 is swiftSoup ver.1.5.2 but I does not installs by command i tried from official site( even more i tried to mention version in a pod file and threw me an error.
How can I install the latest version if swiftSoup by cocoapods?
platform :ios, ’11.0’
This line indicate that what is your pod deployment target so it will install compatible pod with above platform sometime it's happened that after upgrade your project developer forgot to change this target that why sometime old pod install every time. So always change here if you changed the deployment target of your project.
put pod 'SwiftSoup', '~> 1.4' in your pod file and run pod install command and maybe it will help you to get 1.4 version of SwiftSoup
Finally I succeeded to install swiftSoup ver.1.5.8 after a lot of struggling. In general I needed to install classic ancient version of swiftSoup as described in official site (pod 'SwiftSoup') and with big help of Chirag Shah I got to know that I need to mention my target which is iOS 11 (remove hash sign and does this match with current deployment target) and I need to update my old-world pod by pod update command. Thats it. But there was a problem when I inserted command pod update I got and error:
Updating spec repo `master`[!]
Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
So first I needed to resolve this problem with the big help of this link. I found out that I needed update openssl, then ruby, then cocoapod.
Here is copy of steps I took:
1.8.5-p52
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.6
:
2.5.0-rc1
2.5.0
2.6.0-dev
:
$ rbenv install 2.5.0
$ rbenv versions
* system (set by /Users/username/.rbenv/version)
2.5.0
$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
$ rbenv global 2.5.0
$ rbenv versions
system
* 2.5.0 (set by /Users/username/.rbenv/version)
$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
$ gem install cocoapods -n /usr/local/bin
$ which pod
/usr/local/bin/pod
$ pod --version
1.4.0
And then I can return to my project where I uninstalled my old pod and mention target ios 11:
platform :ios, ’11.0’
and eventually insert pod update command then cocopods will update my pod without any error =))
on $pod install it gives warning & fails
The version of CocoaPods used to generate the lockfile (1.5.3) is higher than the version of the current executable (1.5.2)
What is it trying to say ?
macOs : 10.11.6 osx el capitan
my pod version is : 1.5.3
What does"current executable" (1.5.2) means ?
and
how to update it ?
The error you are getting is due to your podfile.lock being built with an older version of Cocoapods. All you need to do is to delete your podfile.lock file and run pod install. This will create a new podfile.lock, with your current dependencies. Note that it should not take too long because your files should already be downloaded, they just need to be linked in said file.
3 solution
deleted ios/podfile.lock and again do $pod install
OR
OS UPDATE
2.1 updated mac to high sierra or higher
2.2 update xcode
2.3 then update pod $sudo gem install cocoapods
2.4 then $cd ios
2.5 then $pod install
OR
do any thing to make version match, then only it will work
For those like me whose cocoapods version is 1.5.2, you can update cocoapods using
sudo gem install cocoapods
and the problem is solved
For checking pod version use
pod --version
For those for which cocoapods version is 1.5.3, you can delete podfile.lock and do pod install. However please note that if the version, of libraries used in your project, is not specified in podfile, then they will be automatically updated to latest vesrion.
$ [sudo] gem install cocoapods
you can update with this command
If you have tried the above methods and it doesn't work, then try this way:
gem update --system
$ sudo gem install cocoapods
you can solve
I've followed the Bluemix Push SDK for iOS following the online documentation:
I am trying to run a sample app - https://github.com/ibm-bluemix-mobile-services/bms-samples-swift-hellopush .
But after doing a pod update - I only get the following pods
BMSAnalyticsAPI (1.0.1)
BMSCore (1.0.0)
BMSPush (1.0.3) .
How can I get the latest pod for the above i.e to
BMSAnalyticsAPI (2.2.0)
BMSCore (2.3.1)
BMSPush (3.1.1) as given their sample video -https://www.youtube.com/watch?v=cOXjn3fuNG0
I am on CocoaPods version 1.1.1, and it worked successfully for me to perform a pod update inside the cloned repository. I recommend either installing this version, or reinstalling your current version. You must perform the pod update inside your project with the Podfile.
$ pod update
Update all pods
Updating local specs repositories
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 6318 and retry the command.
CocoaPods 1.2.1.rc.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.1.rc.1
Analyzing dependencies
Downloading dependencies
Installing BMSAnalyticsAPI (2.2.0)
Installing BMSCore (2.3.1)
Installing BMSPush (3.1.1)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `helloPush_Swift3.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 3 total pods installed.
Doing a pod outdated will list all pods that have updates available too.
I just added a new pod my podfile - pod 'Nuke' to my iOS app
pofile.lock shows that app installed version is 4.1.2
However, on GitHub, Nuke version 5.1 is available. Podspec shows version 5.1
https://github.com/kean/Nuke
What may be the issue?
Once I upgrade cocoa pods to 1.2.0, I was able to install nuke 5.1 version