Alamofire swift library version 4.4没有安装在swift 3.0.2项目中。

时间:2021-12-22 06:59:13

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:-

我正在尝试在我的swift项目中安装Alamofire 4.4,而我正在从指定的链接(https://github.com/Alamofire/Alamofire)中迈出一步,但我正面临着这个问题:-。

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

我的系统中有:Mac os: 10.12.2 x_code版本:8.2.1 swift版本: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.

我在这里学习,请帮忙。

4 个解决方案

#1


9  

Execute the follwoing on your terminal

在你的终端上执行下面的操作。

sudo gem install cocoapods --pre

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

然后将pod文件配置更改为'9.0'到'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

在更改了podfile配置后,打开终端并进入项目路径。然后执行后

'pod install'

#2


0  

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:

您需要向您的Podfile添加一个源语句,这样CocoaPods就知道在哪里搜索您所引用的pods。你可能想要这个在你的播客顶部:

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

#3


0  

CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+.

CocoaPods 1.1.0+被要求建立Alamofire 4.0.0+。

To update CocoaPods you simply install the gem again

要更新CocoaPods,您只需再次安装gem。

$ [sudo] gem install cocoapods

Or for a pre-release version

或者是预发布版本。

$ [sudo] gem install cocoapods --pre

And then try again

然后再试一次

#4


0  

Podfile:

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:

bash命令:

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 :

您可以尝试bash命令:

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$ 

#1


9  

Execute the follwoing on your terminal

在你的终端上执行下面的操作。

sudo gem install cocoapods --pre

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

然后将pod文件配置更改为'9.0'到'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

在更改了podfile配置后,打开终端并进入项目路径。然后执行后

'pod install'

#2


0  

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:

您需要向您的Podfile添加一个源语句,这样CocoaPods就知道在哪里搜索您所引用的pods。你可能想要这个在你的播客顶部:

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

#3


0  

CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+.

CocoaPods 1.1.0+被要求建立Alamofire 4.0.0+。

To update CocoaPods you simply install the gem again

要更新CocoaPods,您只需再次安装gem。

$ [sudo] gem install cocoapods

Or for a pre-release version

或者是预发布版本。

$ [sudo] gem install cocoapods --pre

And then try again

然后再试一次

#4


0  

Podfile:

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:

bash命令:

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 :

您可以尝试bash命令:

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$