2

Trying Xcode 10 GM Seed (10A254a) with our project and the build failed with message "command CompileSwiftSources failed with non-zero exit code".

So far I have tried: 1. Clean and Deep Clean (shift+alt+cmd+k) 2. Delete the DerivedData folder 3. Restart Xcode 4. Restart laptop

all failed to address this issue.

CodeBrew
  • 6,457
  • 2
  • 43
  • 48
  • The GM seed works just fine for just about everyone else. So I would suspect something about your installation. Quit Xcode, restart the computer, clean the caches _including_ Xcode's own cache files (https://stackoverflow.com/questions/5714372/how-to-empty-caches-and-clean-all-targets-xcode-4-and-later/6247073#6247073), and try again. You might have to go even further and delete Xcode entirely. I would suggest that you make a new User and run Xcode there just to prove to yourself that it does in fact work fine. – matt Sep 13 '18 at 18:17
  • 1
    See this answer: https://stackoverflow.com/a/52481653/1485367 – Yaroslav Sep 28 '18 at 06:57

2 Answers2

4

I had the same issue.

When I switched to the Release build configuration it worked. After switching the Debug Compilation Mode to Whole Module from Incremental, both Debug and Release work.

EDIT: After migrating to Swift 4.2 Compilation Mode Incremental now works. However, now the simulator black screens as soon as my app launches.

EDIT2: The black screen issue was something else entirely.

jvdev7
  • 776
  • 6
  • 6
  • I tried changing it to Incremental, now the CompileSwiftSources is gone, but the compiler now complains can't find header file and create a objective-c module for a 3rd party SDK. – CodeBrew Sep 13 '18 at 14:54
  • sorry, should be "I tried changing it to Whole Module" – CodeBrew Sep 13 '18 at 15:05
1

Just as a reference to myself and others who might encounter the same, my problem was eventually resolved after we pinpointed our problem to a third party SDK. Their investigation upon our request turns out, according to their description, to be: Swift ABI (application binary interface) has changed in version 4.2, thus causing incompatibility of the SDK.

After they modified their SDK our project compiled correctly in Xcode 10 seed and official release with both Legacy Build System, and New Build System's Incremental (default) compilation mode.

So Xcode 10 itself is fine, the only complaint is the error message is not informative enough about what's exactly wrong.

CodeBrew
  • 6,457
  • 2
  • 43
  • 48