Cannot install Alamofire 4.0 in Xcode 8.0 Using CocoaPods - cocoapods

I need to upgrade one project to Swift 3.0, that has some libraries by Cocodpods.
So, I've removed all links related with Cocoapods and recreate pod file using pod init and upgrade some version of library such as AlamorFire.
But pod install said
[!] Unable to satisfy the following requirements:
- `Alamofire (~> 4.0)` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Alamofire (~> 4.0)`.
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.
I've updated deployment Target to 9.0 and using cocoapod 1.1.0
For test, I've created new project and added only Alamofire, but the result is same.
If you have some experience, please help me.

try sudo gem install cocoapods --pre
the pod file should look like
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'YourAPP' do
pod 'Alamofire', '~> 4.0'
pod 'SwiftyJSON', :git => 'https://github.com/acegreen/SwiftyJSON.git', :branch => 'swift3'
pod 'NetReachability'
end

Since you have an outdated pod repo, pod install getting failed. First of all you have to update your pod master repo before running pod install. Follow the steps given to update your pod repo and resolve the pod error.
Go to Cocoa Pods repo folder (~/.cocoapods/repos) and delete master folder
Run pod update on terminal. This will take several minutes to update pod repo.
When update get finished, run pod install (if required).
Hope this would be useful for those who are getting similar error :)

Related

How do I update a dependency within a package in Xcode using CocoaPods?

I've installed CDYelpFusionKit using CocoaPods, but I run into an error 65 since the package uses AlamoFireObjectMapper 5.2.0, which is incompatible with Swift 5. AlamoFireObjectMapper 5.2.1 has been released here https://github.com/tristanhimmelman/AlamofireObjectMapper/releases/tag/5.2.1, but it hasn't been released on CocoaPods. I'm trying to figure out how to replace the AlamoFireObjectMapper dependency that comes with the CDYelpFusionKit package with an updated branch from here https://github.com/RomanPodymov/AlamofireObjectMapper. I've tried the following in my podfile, then run pod repo update and pod install:
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/RomanPodymov/AlamofireObjectMapper.git'
platform :ios, '9.0'
target 'Demand' do
use_frameworks!
pod 'Google-Mobile-Ads-SDK'
pod 'CDYelpFusionKit', '~> 1.5.1'
pod 'AlamofireObjectMapper', :git => 'https://github.com/RomanPodymov/AlamofireObjectMapper.git', :branch => 'xcode-10-2-fix'
end
But I get the error:
"[!] CocoaPods could not find compatible versions for pod "AlamofireObjectMapper":
In Podfile:
AlamofireObjectMapper (from `https://github.com/RomanPodymov/AlamofireObjectMapper.git`, branch `xcode-10-2-fix`)
CDYelpFusionKit (= 1.5.1) was resolved to 1.5.1, which depends on AlamofireObjectMapper (= 5.2.0)"
1.) Update CocoaPods to its newest version
2.) Try to delete your lock file and run pod install after that, usually, it installs way newer versions of everything. Also, if your project is ios 9+, modify your platform to something bigger in yor podfile
I hope it is obvious but make a copy of your project folder before trying this solution if you are not using any version control or something along the line

error when installing a pod file Cocoapods version 1.9.1

Podfile Contents
platform :ios, '11.0'
target 'AVWXKit' do
use_frameworks!
pod 'AVWXKit'
end
Terminal Input: pod install
Error Message:
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.
I have tried repo update to no avail. Any help appreciated
Using pod version 1.9.1
It seems that pod was never pushed to trunk: when I do pod search AVWXKit I get:
Unable to find a pod with name, author, summary, or description matching AVWXKit
To work around that, get the pod directly from its repo using:
pod 'AVWXKit', :git => 'https://github.com/JanC/AVWXKit'

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

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

Resources