Xcode 10 转换为 Swift 4.2 失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52412831/
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
Xcode 10 convert to Swift 4.2 fails
提问by Deepak Sharma
回答by Barbatosso
Do you have any libraries in your project? I think you are trying to covert your project with dependencies and there are problems in them with new swift version. Try to uncheck all dependencies except your project and convert to new version of Swift
您的项目中有任何库吗?我认为您正在尝试使用依赖项来隐藏您的项目,并且新的 swift 版本存在问题。尝试取消选中除项目之外的所有依赖项并转换为新版本的 Swift
回答by Mohamed DiaaEldin
I had similar problem, solved it by
我有类似的问题,解决了
1- Change swift lang version in build setting of all app and test targets to 4.2
1- 将所有应用程序和测试目标的构建设置中的 swift lang 版本更改为 4.2
2- build app, errors will happen like UIControlState renamed to UIControl.state
2- 构建应用程序,会发生错误,如 UIControlState 重命名为 UIControl.state
3- fix all of the build errors
3-修复所有构建错误
4- I updated all recommended settings by xcode
4- 我通过 xcode 更新了所有推荐的设置
5- then I asked xcode to convert to swift4.2
5-然后我要求 xcode 转换为 swift4.2
回答by BabyPanda
It's always a good idea to upgrade all dependencies (e.g. via Cocoapods) to its latest version that support Swift 4.2. In my case, I also need to manually change the Swift Language Version build settings for a pod library from Swift 4 to Swift 4.2 as that lib uses some APIs in 4.2 only.
将所有依赖项(例如通过 Cocoapods)升级到支持 Swift 4.2 的最新版本总是一个好主意。就我而言,我还需要手动将 Pod 库的 Swift 语言版本构建设置从 Swift 4 更改为 Swift 4.2,因为该库仅使用 4.2 中的某些 API。
回答by Papon Smc
I have problem too. I find solution to fix this problem in web https://ericasadun.com/2018/09/13/converting-projects-by-hand-to-4-2/
我也有问题。我在网站https://ericasadun.com/2018/09/13/converting-projects-by-hand-to-4-2/ 中找到了解决此问题的解决方案
First
第一的
You try delete pod in pod file and install pod again and pod update in your folder project in command then conversion to Swift 4.2. if it's not work do this in second.
您尝试在 pod 文件中删除 pod 并再次安装 pod 并在命令中的文件夹项目中进行 pod update,然后转换为 Swift 4.2。如果它不起作用,请立即执行此操作。
Second
第二
you try follow do this picture in build setting project or try follow do in link web.
您尝试按照在构建设置项目中执行此图片或尝试在链接 Web 中执行此操作。