I haved installed cocoapods. But I cannot use "pod search" - cocoapods

I haved installed cocoapods On EI. But I cannot use "pod search"
DolphindeMacBook-Pro:~ dolphin$ pod --version
1.0.0
DolphindeMacBook-Pro:~ dolphin$ pod search afnetworking
Creating search index for spec repo 'master'.. Done![!] Unable to find a pod with name, author, summary, or descriptionmatching `afnetworking`
how to fix it

Open terminal and run rm ~/Library/Caches/CocoaPods/search_index.json
pod search AFNetworking
Use sudo rm ~/Library/Caches/CocoaPods/search_index.json in case above command ask for permission

Should be is creating search index, I also is same, you can wait patiently, as follows:
$ pod search AFNetworking
Creating search index for spec repo 'master'.. Done!
Creating search index for spec repo 'master-1'.. Done!
-> AFNetworking (3.1.0)
A delightful iOS and OS X networking framework.
pod 'AFNetworking', '~> 3.1.0'
- Homepage: https://github.com/AFNetworking/AFNetworking
- Source: https://github.com/AFNetworking/AFNetworking.git
- Versions: 3.1.0, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 3.0.0-beta.3,
3.0.0-beta.2, 3.0.0-beta.1, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.4, 2.5.3, 2.5.2,
2.5.1, 2.5.0, 2.4.1, 2.4.0, 2.3.1, 2.3.0, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0,
2.1.0, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0-RC3, 2.0.0-RC2, 2.0.0-RC1, 1.3.4,
1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.1, 1.0, 1.0RC3, 1.0RC2,
1.0RC1, 0.10.1, 0.10.0, 0.9.2, 0.9.1, 0.9.0, 0.7.0, 0.5.1 [master repo]
- Subspecs:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/Security (3.1.0)
- AFNetworking/Reachability (3.1.0)
- AFNetworking/NSURLSession (3.1.0)
- AFNetworking/UIKit (3.1.0)
$ pod --version
1.0.1

With cocoapods installed, take the following steps:
Open a terminal window, and $ cd into your project directory (cd ~/Path/To/Folder/Containing/your/app)
Create a Podfile by running $ pod init
Open the podfile (open -a Xcode Podfile) and add the podline and save the file, for example:
pod 'AFNetworking', '~> 3.0'
Run $ pod install in your project directory
Open App.xcworkspace
Please find a more extended guide here
Hope this helps!

Related

SwiftyDropbox with Alamofire issue

I have the following line in my Podfile:
pod 'Alamofire', '~> 4.7'
Problem is when I add the line 'pod SwiftyDropbox', there is an issue when I run pod update:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Alamofire":
In Podfile:
Alamofire (~> 4.7)
SwiftyDropbox was resolved to 2.0.1, which depends on
Alamofire (~> 2.0.2)
Besides there are warnings in both Alamofire as well as SwiftyDropbox framework. How do I get the latest version of SwiftyDropbox to run in XCode 9.3 and Swift 4?
A few things that aren't mentioned in the SwiftyDropbox documentation, but which are essential for avoiding/solving this:
You need to specify the version of SwiftyDropbox in the Podfile. Like this:
pod 'SwiftyDropbox', '~> 5.0.0'
Once you've specified the version in the Podfile and run pod install again, you'll get this error:
$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "SwiftyDropbox":
In Podfile:
SwiftyDropbox (~> 5.0.0)
None of your spec sources contain a spec satisfying the dependency: `SwiftyDropbox (~> 5.0.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --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.
As the error message says, you need to manually run pod repo update. Why? Who knows, but you need to do it.
Once you've done that, and it has fetched the SwiftyDropbox sources, run pod install and it will work this time. The output will include "Installing SwiftyDropbox (5.0.0)".

.xcworkspace wasn't found after pod install with no error message

I am a newbie in cocoapods and I would be appreciated if you help.
Today I want to use cocoapods to manager my dependencies in my project.
So my Profile is:
platform :ios, '8.0'
target 'TargetName' do
pod 'AFNetworking', '~> 3.0'
end
But after running pod install, I got the message as follow:
pod install
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Generating Pods project
[1] 53417 abort pod install
After that, I can't find the TargetName.xcworkspace and the Podfile.lock but the Pods folder is there.
That's weird because there are no more error messages here.
I installed the cocoapods exactly according to the official guides. And here are the environments:
pod: 1.1.1
ruby: 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
gem: 2.6.8
Xcode: 8.2.1
Thank you very much!
Finally I upgrade cocoapods(now Version 1.2.0.beta.1) and solve my problem.

Cocoapods points to wrong version

I had some problems with one version of the project. I've found this answer where someone suggest steps to remove all cocoapods-connected stuff from the machine and reinstall it. I did follow the steps:
$ 'pod --version'
0.36.1
$ gem list --local | grep cocoapods
cocoapods (0.39.0.rc.1, 0.38.2, 0.38.1, 0.37.2)
cocoapods-core (0.39.0.rc.1, 0.38.2, 0.38.1, 0.37.2)
cocoapods-downloader (0.9.3, 0.9.1)
cocoapods-plugins (0.4.2)
cocoapods-search (0.1.0)
cocoapods-stats (0.6.2, 0.5.3)
cocoapods-trunk (0.6.4, 0.6.1)
cocoapods-try (0.5.1, 0.4.5)
$ gem uninstall cocoapods // and all others from the list above
The problem is that when i again grep all cocoapods, the list was equal to upper one, nothing disappeared.
$ sudo gem uninstall cocoapods
Select gem to uninstall:
1. cocoapods-0.37.2
2. cocoapods-0.38.1
3. cocoapods-0.38.2
4. cocoapods-0.39.0.rc.1
5. All versions
> 5
$ pod --version
// here was the error command not found, so everything fine
$ sudo gem install cocoapods
Fetching: cocoapods-0.38.2.gem (100%)
Successfully installed cocoapods-0.38.2
Parsing documentation for cocoapods-0.38.2
Installing ri documentation for cocoapods-0.38.2
Done installing documentation for cocoapods after 2 seconds
1 gem installed
$ pod --version
Could not find proper version of cocoapods (0.36.1) in any of the sources
Run `bundle install` to install missing gems.
But why does it want me to install 0.36.1? Anyway, as it asked, I did:
$bundle install
Installing cocoapods-core 0.36.1
Installing cocoapods-downloader 0.8.1
Installing cocoapods-plugins 0.4.1
Installing cocoapods-trunk 0.6.0
Installing cocoapods-try 0.4.3
Installing cocoapods 0.36.1
// Many "using" dependencies
So now when I run:
$ pod --version
0.36.1
And I'm stuck :) Why can't I have newest release version? Maybe pod --version points to the newest version of cocoapods-core instead of only cocoapods, so everything is ok and I have the correct version?
Check if you use Gemfile and there is specified the version of
cocoapods.
You can use specific version by pod *version* action. For example: pod _1.5.0.beta.1_ update or pod _1.5.0.beta.1_ install
For anyone coming to this in an attempt to update cocoapods. After doing all of the above I wasn't able to get this resolved. I then headed to the resolved answer and being unwilling to remove RVM, I tried to resolve this issue another way.
I found that my issue did indeed lie in my Gemfile.
First, run
gem install cocoapods to ensure you have the latest version, or whatever specified version you were looking for downloaded.
Second, ensure your projects Gemfile hasn't specified a cocoapods version number and instead simply specifies it as:
gem "cocoapods"
If yours doesn't, change this and run bundle update to regenerate the Gemfile.lock file and your problem should be solved. If not, go ahead and delete the Gemfile.lock file altogether and then run bundle update. You can easily check to see which gem version will be loaded by opening the Gemfile.lock file and searching for cocoapods-core <version number here>
At this point, you can go into your project and run
pod setup
and then check the cocoapods version with
pod --version
and now FINALLY you are free to run
pod install
to replace the Podfile.lock file and get back to your happy dev life. Hope that helps someone and saves them from burning hours.
It seems something got messed up in my ruby version. I still have no idea what and why. I've managed to fix it via this solution: https://stackoverflow.com/a/25021772/849616. After it everything works correctly.
You might face this issue when it comes migrating to a higher Swift version. Assuming that you already have cocoapods installed, you probably need to run bundle update command (possibly with sudo).
For more details, you could check: https://guides.cocoapods.org/using/a-gemfile.html
Additionally, I'd suggest to do the following:
Install the latest Xcode version.
Clear derived data (not just clean project) in your project.
Run pod update command.
I have the same problem.
In my project, pod --version and gem which cocoapods always return diffrence version.
All I had to do is remove Gemfile.lock in my project and bundle install again. It removed the locked cocoapods version and install a new one.
Hope that helps some one here.
I ran pod install and I've got this error:
Could not find proper version of cocoapods (1.11.3) in any of the sources
and I ran:
bundle install
after that pod install worked properly

cocoapods: cant install latest AMScrollingNavbar through cocoapods

pod --version : 0.38.2
Unable to install latest version of AMScrollingNavbar through cocoapods, if I don't specify the version, it installs version 1.5.1.
If I specify version as: pod 'AMScrollingNavbar', '~> 2.0.0'
I get: Analyzing dependencies
[!] Unable to satisfy the following requirements:
AMScrollingNavbar (~> 2.0.0) required by Podfile
If I do: pod 'AMScrollingNavbar (~> 2.0.0)'
I get: Analyzing dependencies
[!] Unable to find a specification for AMScrollingNavbar (~> 2.0.0)
changed to pod 'AMScrollingNavbar', '~> 2.0.0-beta7' and installed latest one.

How to find out the version of installed cocoa pods?

How to find out the version of installed cocoa pods?
I'm not asking about the version of the cocoa pods gem, but the version of the pods themselves. Ideally it would say "pod GreatViewController is installed in version 1.2.3, new version available: 1.2.6".
Is there something like that?
EDIT
Based on your clarification you're looking for pod outdated. You can see more information about this with pod outdated --help
Original answer before question was edited
The command you want is pod --version
In the future you should use pod --help to find answers such as this. You can also use pod COMMAND --help to get help for specific commands.
You will find the version # in your Podfile.lock of all the pods you are currently using in your project. You will find this file at the same location as your Podfile.
This is how mine looks like:
PODS:
- Alamofire (3.4.1)
- EPSignature (1.0.2)
- Kingfisher (2.4.2)
- MBProgressHUD (0.9.2)
- SwiftyJSON (2.3.2)
DEPENDENCIES:
- Alamofire (~> 3.4)
- EPSignature
- Kingfisher
- MBProgressHUD (~> 0.9.1)
- SwiftyJSON
SPEC CHECKSUMS:
Alamofire: 01a82e2f6c0f860ade35534c8dd88be61bdef40c
EPSignature: 1f925f20b837046de46b4d396bc6e432ea383908
Kingfisher: 05bf8d04408aaa70fcd2c8c81b9f1d0f1ad313dd
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a
PODFILE CHECKSUM: 95eb36b090480f40d91543881d6ddb76bb1b8ca8
COCOAPODS: 1.0.1
To get the version of cocoa pods
pod --version
To get the version of your pod, look in the Podfile.lock
When you install or update the pod, you can see the versions of both.
if You are finding the version of a particular pod installed, then follow below steps:
Open Xcode
Click on "Project Navigator"
Click on "Pods"
Open The Pod you wanna know the version of
Expand it
Expand the "Supporting Files" folder
Click On yourpodname.plist
Read the Bundle Version string, short
Open Terminal.
Change directory to your project and type the following command to open the Podfile.lock file.
$ open Podfile.lock -a Xcode
pod search pod_name
example
pod search Alamofire
So you should have the pod name to use this command and it will give you a response like the following in the command line
-> Alamofire (4.7.3)
Elegant HTTP Networking in Swift
pod 'Alamofire', '~> 4.7.3'
- Homepage: https://github.com/Alamofire/Alamofire
- Source: https://github.com/Alamofire/Alamofire.git
- Versions: 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.0, 4.5.1, 4.5.0, 4.4.0, 4.3.0,
4.2.0, 4.1.0, 4.0.1, 4.0.0, 3.5.1, 3.5.0, 3.4.2, 3.4.1, 3.4.0, 3.3.1, 3.3.0,
3.2.1, 3.2.0, 3.1.5, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.1, 3.0.0,
3.0.0-beta.3, 3.0.0-beta.2, 3.0.0-beta.1, 2.0.2, 2.0.1, 2.0.0, 2.0.0-beta.4,
2.0.0-beta.3, 2.0.0-beta.2, 2.0.0-beta.1, 1.3.1, 1.3.0, 1.2.3, 1.2.2, 1.2.1,
1.2.0, 1.1.5, 1.1.4, 1.1.3 [master repo]

Resources