10

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?

regina_fallangi
  • 2,080
  • 2
  • 18
  • 38
  • I know that you already tried restarting and rebuilding everything, the only working solution is - Reinstall the Xcode!!!! – Kampai Mar 23 '20 at 13:33

1 Answers1

28

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.

Yaroslav
  • 2,435
  • 1
  • 19
  • 36
  • 8
    it didn't work, still i am getting same error. – Arshad Shaik Nov 29 '18 at 06:28
  • life saver with known issue (45274900) – Sourabh Shekhar Apr 02 '19 at 10:32
  • Finally revealed what the real issue was! – funct7 May 03 '19 at 10:50
  • Faced the issue in Xcode 11.3. Done everything related to derived data clear, pod remove and everything available on internet but no luck and the app was not debugging on real device. Then thought that it could be the issue of Xcode crash, just removed the Xcode to trash and cleared the trash and then reinstalled the fresh copy of Xcode 11.3. It worked for me, thanks to my assumption. – Syed Faizan Ahmed May 21 '20 at 20:01