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?
A non-zero exit status indicates failure. This seemingly counter-intuitive scheme is used so there is one well-defined way to indicate success and a variety of ways to indicate various failure modes. When a command terminates on a fatal signal whose number is N , Bash uses the value 128+ N as the exit status.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With