DHYAN CHANDRA SINGH
DHYAN CHANDRA SINGH

Reputation: 61

Alamofire swift library version 4.4 is not installing in swift 3.0.2 project

I am trying to install Alamofire 4.4 in my swift project with pod i am following the step from the given link (https://github.com/Alamofire/Alamofire) but i am facing this issue:-

[!] 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.

I have in in my System : Mac os : 10.12.2 x_code version : 8.2.1 swift version : 3.0.2

pod File configuration :

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'testAlarmofireAndswiftyJson' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for testAlarmofireAndswiftyJson
  pod 'Alamofire', '~> 4.4'
end

I am stucking here please help.

Upvotes: 2

Views: 4812

Answers (4)

GeekMeng
GeekMeng

Reputation: 1

Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target '02-Weibo' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # Pods for 02-Weibo

       pod 'Alamofire', '~> 4.4'
       pod 'SnapKit', '~> 3.2.0'
end

bash command:

appledeMacBook-Pro:Weibo apple$ pod install
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Installing Alamofire (4.4.0)
Installing SDWebImage (4.0.0)
Installing SVProgressHUD (2.1.2)
Installing SnapKit (3.2.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `Weibo.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 6 dependencies from the Podfile and 5 total pods installed.

[!] There are duplicate dependencies on `SnapKit` in `Podfile`:

- SnapKit (~> 3.2.0)
- SnapKit

you can try bash command :

appledeMacBook-Pro:Weibo apple$ pod update
Update all pods
Updating local specs repositories

CocoaPods 1.2.1 is available.
To update use: `sudo gem install cocoapods`

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

Analyzing dependencies
Downloading dependencies
Using AFNetworking (3.1.0)
Using Alamofire (4.4.0)
Using SDWebImage (4.0.0)
Using SVProgressHUD (2.1.2)
Using SnapKit (3.2.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 5 dependencies from the Podfile and 5 total pods installed.
appledeMacBook-Pro:Weibo apple$ 

Upvotes: 0

Shahrukh
Shahrukh

Reputation: 752

CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+.

To update CocoaPods you simply install the gem again

$ [sudo] gem install cocoapods

Or for a pre-release version

$ [sudo] gem install cocoapods --pre

And then try again

Upvotes: 0

Vikash Kumar
Vikash Kumar

Reputation: 636

Execute the follwoing on your terminal

sudo gem install cocoapods --pre

Then change pod file configuration to '9.0' to '10.0'

platform :ios, '10.0'

target 'project_name' do
    pod 'Alamofire', '~> 4.4'
end

After changing the podfile configuration open terminal and go to project path. Then execute following

'pod install'

Upvotes: 4

DarkDust
DarkDust

Reputation: 92384

You need to add a source statement to your Podfile so CocoaPods knows where to search for the pods you're referencing. You likely want this at the top of your Podfile:

source 'https://github.com/CocoaPods/Specs.git'

Upvotes: 0

Related Questions