Xcode 10构建失败,并显示'Command CompileSwift失败,退出代码为非零 [英] Xcode 10 build fails with 'Command CompileSwift failed with a nonzero exit code

查看:4020
本文介绍了Xcode 10构建失败,并显示'Command CompileSwift失败,退出代码为非零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将Xcode更新到了版本10,并在尝试构建项目时开始收到一个奇怪的错误.我目前使用的是Swift 4.0,但我确实尝试过升级到Swift 4.2.但是当我这样做的时候,我在许多框架中都收到了同样的错误.

I updated Xcode to version 10 recently and started to receive a strange error when trying to build my project. I'm currently on Swift 4.0 and I did try to upgrade to swift Version 4.2. But when I did I received this same error in many of my frameworks.

命令编译Swift失败,退出代码非零

Command Compile Swift failed with a nonzero exit code

到目前为止,我已经删除了派生文件夹.更新了所有Pod,还删除了所有Pod,并使用下面的终端命令重新安装了它们.

So far I've deleted the derived folder. Updated all pods, also deleted all pods and reinstalled them using the terminal commands below.

sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod clean
pod install

这无法解决我的问题.但是,我发现可以在Build Setting -> valid architectures中添加arm64体系结构并启用自动代码的方法行得通,但是,当我检查它是否已经存在并且已经启用代码签名时.

This didn't work to fix my issue. However, I found something that could work which was adding arm64 architecture in Build Setting -> valid architectures and enabling automatic code But, when I checked it was already there and code signing was enabled already.

此外,我确实还有一些其他与框架有关的构建错误.

Additionally, I do have a few other build errors that have to do with frameworks.

SwiftMessages

"SwiftMessages.Config"类型的值没有成员"presentationContext"

Value of type 'SwiftMessages.Config' has no member 'presentationContext'

WhatsNewKit

呼叫中缺少参数'backgroundColor'的参数

Missing argument for parameter 'backgroundColor' in call`

我与每个框架的开发人员讨论了问题,以寻求有关这些问题的帮助.

I opened issues with the developers of each of these frameworks to seek help with these issues.

在SwiftMessage GitHub上发布 在WhatsNewKit GitHub上发布问题

当我单击presentationContext时,它将带我进入SwiftMessages框架内的结构.通常,当我收到没有成员"警告时,我无法单击以查看其存在的原始位置.

When I click presentationContext it brings me to the struct within the SwiftMessages Framework. Usually, when I've had the "has no member" warning I cannot click to see the original place where it exists.

我认为这与可可豆荚有关,但尚未找到解决方案.我该怎么做才能解决此问题?如果有人可以提供帮助,将受到不胜感激的是,被困在这里一天了.

I assume this has something to do with cocoa pods, but haven't been able to find a solution yet. What can I do to correct this issue? If anyone could help would be deeply appreciated been stuck on this for a day now.

更新: 这两个框架的最新版本适用于Swift 4.2.当我将每个框架的版本更改为在swift 4.0中构建的框架时,我就可以构建项目.

Update: The two frameworks latest builds were for swift 4.2. When I changed the version of each framework to one that was built in swift 4.0 I got the project to build.

推荐答案

请确保您的项目Swift语言版本是正确的版本. SwiftMessages 6.0.0可与Swift 4.2一起使用.

Make sure that, your project Swift Language Version is in the proper version. SwiftMessages 6.0.0 works with Swift 4.2.

这篇关于Xcode 10构建失败,并显示'Command CompileSwift失败,退出代码为非零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆