pod更新到3.4.1后,xcode 8 beta Alamofire编译器错误

mar*_*cks 6 xcode swift alamofire

我已经使用git和run下载了一个传统的swift应用程序pod update.之后git add -A,我使用xcode 8 beta打开工作区,然后使用Product - > Clean and build我得到40个swift编译器Alamofire错误.我没有运行convert o swift 2.3或swift 3.

Podfile.lock的Alamofire版本为3.4.1.

在Podfile中我将版本设置为ios 10.0,在Alamofire中也将infoDictionary版本设置为10.0,但它没有任何区别.

它们大多是语法错误,例如NSURL需要重命名的URL等.

我找不到谷歌这个问题的任何答案.

Gra*_*rks 2

Xcode 8 针对 iOS 10 SDK 进行编译。这与 iOS 9 SDK 略有不同,因此会出现错误。您将无法将 Xcode 8 与 Swift 2.2 代码一起使用。

如果您查看 Alamofire 分支,https://github.com/Alamofire/Alamofire/branches,您将看到 2.3 和 3.0 兼容性方面的工作。

另外,请阅读此线程以了解有关如何使用这些分支的详细信息:https://github.com/Alamofire/Alamofire/issues/1312

  • 我在 Podfile 中使用以下条目为 swift 2.3 安装 Alamofire,上面链接中提供的内容不起作用。`pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift2.3'` (2认同)
  • 对我来说,最后我使用了 Alamofire 3.5.0 和 Xcode 8 / Swift 2.3 (2认同)