Command CompileSwiftSources failed with a nonzero exit code Xcode 10 [duplicate]

前提是你 提交于 2019-12-28 04:14:34

问题


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:

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

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

: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

What can I do?


回答1:


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

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.



来源:https://stackoverflow.com/questions/52350896/command-compileswiftsources-failed-with-a-nonzero-exit-code-xcode-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!