Alamofire swift库版本4.4没有安装在swift 3.0.2项目中

DHY*_*NGH 2 iphone xcode ios swift alamofire

我正试图在我的快速项目中安装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.
Run Code Online (Sandbox Code Playgroud)

我在我的系统中:Mac OS:10.12.2 x_code版本:8.2.1 swift版本:3.0.2

pod文件配置:

# 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
Run Code Online (Sandbox Code Playgroud)

我在这里坚持请帮助.

Vik*_*mar 11

在终端上执行以下操作

sudo gem install cocoapods --pre
Run Code Online (Sandbox Code Playgroud)

然后将pod文件配置更改为'9.0'到'10 .0'

platform :ios, '10.0'

target 'project_name' do
    pod 'Alamofire', '~> 4.4'
end
Run Code Online (Sandbox Code Playgroud)

更改podfile配置后打开终端并转到项目路径.然后执行以下

'pod install'
Run Code Online (Sandbox Code Playgroud)

  • @DHYANCHANDRASINGH:打开终端并激活此命令'pod repo update'然后尝试 (2认同)