Home > Software engineering >  Unable to compile dependencies on Xcode 13
Unable to compile dependencies on Xcode 13

Time:07-10

The error: "Command CompileSwiftSources failed with a non-zero exit code"

Cause: Simply messing with 2 Xcode installs by installing both Xcode 13 and Xcode 14 beta (with Xcodes)

Consequences: First, Xcode lost connection with SwiftUI Previews device. Then compiling issues occur. All simulators were also gone from the list. The error keeps showing up for each dependency of the project.

Unsuccessful attempts to solve this:

  • Uninstalling Xcode by moving it to trash, even performing a clean-uninstall with CleanMyMacX
  • Manually wiping every Xcode-related file possible (browse the internet or perform a find / -path "*Xcode*" 2> /dev/null)
  • Recreating a brand new project and moving all previous Swift files into it
  • Removing and re-adding a bunch of times all my dependencies

Solution: Check the answer below.

CodePudding user response:

The solution came from nowhere. I was trying to open Xcodes to check which versions were installed on the Mac when I accidentally pressed enter on the wrong Spotlight result: Xcode Server Builder.

I have no clue what that is, but I assume it's an embedded Xcode component used for compilation. That is, I opened it and it prompted me some Accessibility access request. I fulfilled it because why not, and I tried by curiosity to compile with B, and it worked.

About the empty list of simulators, I simply downloaded the latest available iOS 15.4 Simulator, and every device showed up as before.

  • Related