swift - 在 Xcode 9 Swift 3 Watch 应用程序中安装 Alamofire

标签 swift cocoapods alamofire

我已经关注了 installation instructions但是在 Xcode 9.2 中打开项目的 xcworkspace 时出现以下错误

The target “Alamofire” contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets. Use Xcode 8.x to migrate the code to Swift 3.

不确定我是否有旧版本的 Alamofire:我的 Podfile 包含

source 'https://github.com/CocoaPods/Specs.git' platform :ios, '9.0' use_frameworks! target 'raceQs' do pod 'Alamofire', '~> 4.5' pod 'DLAlertView' pod 'CocoaAsyncSocket' pod 'GoogleAnalytics-iOS-SDK' pod 'SWRevealViewController' pod 'SSKeychain' pod 'SSZipArchive' pod 'mailcore2-ios' pod 'CrashlyticsFramework' end

pod 安装报告

Installing Alamofire (4.6.0)

最佳答案

不要通过 Alamofire 版本。对您的 Podfile 进行以下更改。

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

target 'raceQs' do
  pod 'Alamofire'
  //rest of your pods
end

关于swift - 在 Xcode 9 Swift 3 Watch 应用程序中安装 Alamofire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48331778/

相关文章:

swift - Alamofire 和 PromiseKit 返回 Promise<[T]>

cocoa-touch - 在类的实例中使用类变量

json - 解码 Json Swift 4 Codable Type Any

ios - 从 Cocoa Touch 框架创建 CocoaPod

ios - 如何使用 alamofire 实现 put http 请求

ios - 使用 Alamofire 解析 json 的问题

swift - DetailViewControllers 内容被截断

ios - 多个按钮未出现在 UICollectionViewCell 中

xcode - 如何在 Xcode 中使用加号 (+) 导入 Swift 模块

ios - CocoaPod 结果名称冲突