命令 CompileSwiftSources 失败,退出代码非零 Xcode 10 [英] Command CompileSwiftSources failed with a nonzero exit code Xcode 10

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

问题描述

我阅读了一些相同的问题,但他们的解决方案对我不起作用.我的项目在 Xcode 9.4 中工作,但是当我来到 Xcode 10 并重新创建我的项目时,我收到此错误.我的项目必须添加/usr/include/libxml2 ,如果我添加它,我会得到一个不同的错误 redefinition of madule libxml2.日志是:

I read some same issue but their solutions did not work for me. My project works in Xcode 9.4, but when I come to Xcode 10 and recreate my project, I get this Error. My project must add /usr/include/libxml2 , and if I add this, I get a different Error redefinition of madule libxml2. The log is:

在 OTHER_SWIFT_FLAGS 中添加-Xcc -I$(SDKROOT)/usr/include/libxml2"Xcode 项目.

Add "-Xcc -I$(SDKROOT)/usr/include/libxml2" to OTHER_SWIFT_FLAGS in Xcode project.

如果我添加-Xcc -I$(SDKROOT)/usr/include/libxml2",出现如下错误:

If I add "-Xcc -I$(SDKROOT)/usr/include/libxml2", there is the following error:

:0: 错误: 未知参数: '-Xcc-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/libxml2'命令 CompileSwiftSources 失败,退出代码非零

:0: error: unknown argument: '-Xcc -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/libxml2' Command CompileSwiftSources failed with a nonzero exit code

我能做什么?

推荐答案

这是一个已知问题,如 Xcode 10 发行说明的 Swift 4.2 发行说明.

This is a known issue as stated in Swift 4.2 Release Notes for Xcode 10 Release Notes.

解决方法:通过添加名为 SWIFT_ENABLE_BATCH_MODE 的用户定义构建设置并将其设置为 NO 来禁用批处理模式.

Workaround: Disable batch mode by adding a user-defined build setting named SWIFT_ENABLE_BATCH_MODE and set it to NO.

转到目标的构建设置并添加此用户定义设置.为我工作.

Go to your target's build settings and add this user-defined setting. Worked for me.

这篇关于命令 CompileSwiftSources 失败,退出代码非零 Xcode 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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