6

I'm repeatedly getting this error with my code using Xcode.

<unknown>:0: error: merge-module command failed with exit code 1 (use -v to see invocation)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

I've tried everything I could find on how to fix the issue and nothing has worked. I've switched my optimization level to None[-Onone], I've performed cleans and I've run the xcodebuild function in Terminal, but nothing has worked. Any ideas on how to fix this issue?

2 Answers 2

4

I just had the same issue. I'm using Carthage and finally figured out that, for some reason, I had run carthage update with sudo which changed the permissions of the compiled frameworks. I fixed this by running the following commands.

brew upgrade carthage sudo rm -rf Carthage/ carthage update

Then clean the xcode project and re-build.

Hope that helps.

5
  • Carthage? I'm not running that or anything external. The only thing I'm running is GameKit. Commented Nov 12, 2015 at 1:40
  • It turns out that, as you suggested, the problem had to do with a framework. After I deleted and re-added GameKit, my code started working perfectly. Thanks. Commented Nov 12, 2015 at 3:35
  • Looks like we had the same problem with different causes. I'll leave me answer in case it helps someone else that is using Carthage.
    – Col
    Commented Nov 12, 2015 at 3:37
  • This answer helped me HUGELY in that my issue has to do with permission errors. Not exactly the same but same symptom and same path to resolution. Thank you so much for taking the time to share. Commented Sep 15, 2016 at 22:33
  • For me, the answer was "ignore the permissions and ownership that you see on the file system and delete ALL carthage output directories" for this new user that I'm using on my Mac. Commented Sep 15, 2016 at 23:24
0

In my case the actual error was described a lot further down.

It was a header file that couldn't be found because I hadn't set the Header Search Paths in my target Build Settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.