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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38084751/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:59:15  来源:igfitidea点击:

xcode 8 beta Alamofire compiler errors after pod update to 3.4.1

xcodeswiftalamofire

提问by markhorrocks

I have downloaded a legacy swift app using git and run pod update. After git add -A, I open the workspace using xcode 8 beta then Product -> Clean and build I get 40 swift compiler Alamofire errors. I have not run convert o swift 2.3 or swift 3.

我已经使用 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 has version 3.4.1 for Alamofire.

Podfile.lock 的 Alamofire 版本为 3.4.1。

in Podfile I set the version to ios 10.0 and in Alamofire info also set infoDictionary version to 10.0 but it made no difference.

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

Mostly they are syntax errors like NSURL needs to be renamed URL, etc.

大多数情况下,它们是语法错误,例如 NSURL 需要重命名 URL 等。

I can't find any answers to this problem with Google.

我无法通过 Google 找到此问题的任何答案。

采纳答案by Graham Perks

Xcode 8 compiles against the iOS 10 SDK. This differs slightly from the iOS 9 SDK and thus the errors. You won't be able to use Xcode 8 with Swift 2.2 code.

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

If you look at the Alamofire branches, https://github.com/Alamofire/Alamofire/branches, you'll see work on 2.3 and 3.0 compatibility.

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

Also, read this thread for details on how to use those branches: https://github.com/Alamofire/Alamofire/issues/1312.

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