9

I've downloaded the latest Xcode 11.2.1. When I build I'm getting this error.

<unknown>:0: error: using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code

How can I resolve this?

4
  • Does this answer your question? Command CompileSwiftSources failed with a nonzero exit code Xcode 10 and this: stackoverflow.com/questions/52415877/… Commented Dec 5, 2019 at 10:19
  • Do you use any obj-c code in the project? Is this error occurred only in old or newly created project also replicated the same error? Commented Dec 5, 2019 at 10:28
  • Note: Duplicate of this Deleted question (with no answers), and considering the time of the same question on the official forums, it was also happening with Xcode 11.0. Commented Dec 5, 2019 at 12:58
  • Continuation of previous comment: both linked questions show that they were using CocoaPods, so I suspect that there are simply using outdated versions of CocoaPods and/or Xcodeproj dependency. For Xcode 11, you need to use CocoaPods 1.8.4 and nothing older. Commented Dec 5, 2019 at 13:06

1 Answer 1

17

I solved this build error by setting Build Options -> Build Libraries for Distribution in the targets Build Settings to No.

I stumbled upon this config change that worked for me so I don't have any evidence/research to back up why it works. And I have only tried this for debug builds, will update my answer if anything changes. Your milage may vary.

My project specs below:

Xcode 11.1 (11A1027)

Brownfield React Native iOS app

Sign up to request clarification or add additional context in comments.

8 Comments

Umm... I have just enabled this option because of error: module compiled with Swift 5.1.3 cannot be imported by the Swift 5.2 compiler So you either have one error or another?
@SimonMoshenko I've come into similar situation, have you ever find solution to this issue?
true that, I have also encountered same issue similar to @SimonMoshenko do we have any update here?
I don't think I found a solution. I think I had to ditch an import statement to my framework, or whatever was causing the issue.
Setting Build Libraries for Distribution to NO is not a proper solution because many might require to distribute by XCFramework which forces it to be YES.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.