Cocoapods installs pods not specified in projects Podfile - xcode

When I run pod install cocoapods installs several pods not listed in the current projects Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'PodUser' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for PodUser
pod "PodTest"
end
My pod install output:
pod install
Analyzing dependencies
Downloading dependencies
Using AFNetworking (3.1.0)
Using FirebaseAnalytics (3.9.0)
Using FirebaseCore (3.6.0)
Using FirebaseInstanceID (1.0.10)
Using Google (3.1.0)
Using GoogleAnalytics (3.17.0)
Using GoogleToolboxForMac (2.1.1)
Using PodTest (0.0.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 8 total pods installed.

CocoaPods installs the specified pods and all of those pods' dependencies.
If you look at PodTest.podspec and its dependencies and recursively follow the podspec's for those dependencies, it should match the pods that get installed.
See also the file Podfile.lock that gets created alongside the Podfile to see a list of the relevant pods and their dependencies.

Related

CocoaPods could not find compatible versions for pod "Firebase/Core"

Here is my Podfile:
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'Unity-iPhone' do
pod 'Google-Mobile-Ads-SDK', '7.3.1'
pod 'Firebase/Core'
end
It works well when I run 'pod install'
output:
Analyzing dependencies
Downloading dependencies
Using Firebase (4.13.0)
Using FirebaseAnalytics (4.2.0)
Using FirebaseCore (4.0.20)
Using FirebaseInstanceID (2.0.10)
Using Google-Mobile-Ads-SDK (7.3.1)
Using GoogleToolboxForMac (2.1.4)
Using nanopb (0.3.901)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 7 total pods installed.
Perfect, everything is fine,But if I add a specific version with FirebaseCore,like below code:
pod 'Firebase/Core','4.0.20'
and 'pod install' again
output:
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In Podfile:
Firebase/Core (= 4.0.20)
None of your spec sources contain a spec satisfying the dependency: `Firebase/Core (= 4.0.20)`.
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.
Actually,FirebaseCore with 4.0.20 is exist,So how should I fix it?
I fixed it right now, just change Firebase/Core to FirebaseCore
(I was checked FirebaseCore.podspec file in GitHub.)
The podspec versioning for Firebase and FirebaseCore are separate, so you shouldn't use them interchangeably. The Firebase pod is a parent for the subspecs Firebase/Core, Firebase/Analytics, etc., but FirebaseCore is not using the same versioning because FirebaseCore is not a subspec of Firebase, whereas Firebase/Core is.
For reference, the Firebase podspec is here: https://github.com/CocoaPods/Specs/blob/980d013a857e7ef973531f1cf85ddb5b8a56d1b0/Specs/0/3/5/Firebase/5.10.0/Firebase.podspec.json
Run the following commands in your project/ios folder in the order:
pod update Firebase/Core
pod install --repo-update

Cocoapods cannot install pod

I ran pod install after I updated my Podfile, the LeanCloud pod was not installed, and I got the following message:
Analyzing dependencies
[!] There are only pre-release versions available satisfying the following requirements:
'LeanCloud', '>= 0'
You should explicitly specify the version in order to install a pre-release version
Here is how my Podfile looks like:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'todolist' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for todolist
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'LeanCloud', '>= 0'
end
I'm running on macOS 10.12.3, with Cocoapods Version 1.2.0
You have to specify which version of a dependency you’d like to use. Take a look here how versioning works:
== 1.0 means “Use exactly version 1.0”
>= 1.0 means “Use version 1.0 or higher”
~> 1.0 means “Use any version that’s compatible with 1.0″, essentially meaning any version up until the next major release. That is:
If you specify ~> 1.7.5, then any version from 1.7.5 up to, but not including 2.0, is considered compatible.
Likewise, if you specify ~> 2.0 then Cocoapods will use a version 2.0 or later, but less than 3.0.
Compatibility is based on Semantic Versioning
From here, you have to choose which LeanCloud version you want to use. Then change it accordingly in your pod file based on those steps above.
I am not very good in English
I think you did not specify a mobile version
platform :ios, '9.0' <-You should try to open this sentence
Somehow I got it to work by move the line pod LeanCloud to be the first pod, and ran pod update.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'todolist' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for todolist
pod 'LeanCloud'
pod 'Alamofire'
pod 'SwiftyJSON'
end
⇒ pod update
Update all pods
Updating local specs repositories
CocoaPods 1.2.1.beta.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.beta.1
Analyzing dependencies
Downloading dependencies
Installing Alamofire 4.2.0 (was 4.4.0)
Installing LeanCloud (10.0.0)
Using SwiftyJSON (3.1.4)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.

Unable to satisfy requirements when specifying version in podfile

I'm using the Cocoapods app. When trying to install the current Alamofire, I get the following error:
Analyzing dependencies
[!] Unable to satisfy the following requirements:
- `Alamofire (~> 4.4)` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Alamofire (~> 4.4)`.
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
This is my podfile:
project 'MyApp.xcodeproj'
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Alamofire', '~> 4.4'
end
If I remove the version and just use pod 'Alamofire', it installs version 4.0.1. Why?
The issue is as per the last line of the log.
You need to run pod repo update
There appears to be an option in the app in the menu Specs Repos that has an update button for me. However this does not seem to work.
Running the command line then allowed mre to run Build->Install from the Cocoapods app
This might be happening due to the cocoa pod version required by the new almofire version is higher than what u have installed in your system. Please check version of ypu pod by pod --version in command line , if it is less than 1.0 update pod spec , you can find the steps here .https://guides.cocoapods.org/using/getting-started.html
Your new pod will be installed. Also the when u don not specify a version in your pod file than cocoa pods itself selects the latest version it supports and install it .Thats why your almofire was getting updated to 4.0.1.,Hope this helps you.

How i can update my cocoa repo?

Im trying to use the version > 1.24 of Lock (https://github.com/auth0/Lock.iOS-OSX), but my cocoa repo has not available this version. I execute pod search Lock and i see the follow info:
Lock (1.13.0)
A library that uses Auth0 for Authentication with Native Look & Feel
pod 'Lock', '~> 1.13.0'
- Homepage: https://github.com/auth0/Lock.iOS-OSX
- Source: https://github.com/auth0/Lock.iOS-OSX.git
- Versions: 1.13.0, 1.12.1, 1.12.0, 1.11.3, 1.11.2, 1.11.1
The version in the repo is 1.27, and my repo is old. I try to update using pod repo update but still unavailable
¿Someone can help me?
Im trying to use this podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
target 'TalkClassTest' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for TalkClassTest
target 'TalkClassTestTests' do
inherit! :search_paths
pod 'Lock', '~> 1.24'
end
end
but when i execute pod install i obtain this erros:
[!] Unable to satisfy the following requirements:
- `Lock (~> 1.24)` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Lock (~> 1.24)`.
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.
MacBook-Air-de-Randall:TalkClassTest Randal$
thank to everyone, the solution applied is execute the follow commands: pod repo remove master and after pod setup

CocoaPods 1.0.0b6 incorrect subspec dependents header paths when use_frameworks

I've got a simple simple PodFile for an empty single view app target and project named 'tf' in workspace 'ws'
platform :ios, '8.0'
use_frameworks!
workspace 'ws'
project 'tf/tf'
target 'tf' do
pod 'ShareKit/Facebook', '~> 5.0.0'
pod 'ShareKit/Tumblr', '~> 5.0.0'
end
Using 1.0.0b6 it chugs out:
MacBook-Pro:testflurry steve$ pod install
Analyzing dependencies
Downloading dependencies
Installing Bolts (1.7.0)
Installing Facebook-iOS-SDK (3.24.4)
Installing PKMultipartInputStream (1.1.0)
Installing SAMTextView (0.2.2)
Installing SDWebImage (3.7.5)
Installing SSKeychain (1.2.3)
Installing ShareKit (5.0.0)
Installing UIActivityIndicator-for-SDWebImage (1.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 8 total pods installed.
It won't build, an import inside sharekit fails to be found
#import <UIActivityIndicator-for-SDWebImage/UIImageView+UIActivityIndicatorForSDWebImage.h>
The reason seems obvious, when you inspect ShareKit target in the pods project, the HEADER_SEARCH_PATHS ends up as
"${PODS_ROOT}/Headers/Private"
"${PODS_ROOT}/Headers/Public"
I gather that ${PODS_ROOT} evaluates to ${SRCROOT} or the project dir and the headers folder is empty. Seems like I'm either missing something fundamental or something isn't right. 'little help?

Resources