Skip to main content
Kelvas blog
  1. Posts/

XCode: Build failed without any errors 🤔

·306 words·2 mins

It’s all in the title: have you ever had this problem? It’s still very strange. And it looks like this:

XCode: Build failed but no errors
XCode: Build failed but no errors

What’s going on? #

After several searches it turns out that if you want to have more information on the errors in question, you have to go to the “Report navigator” which is the last icon in the left sidebar of your screen.

XCode: Report navigator
XCode: Report navigator

As you can see there is much more information here than before. The problem comes from the compilation of a file whose module is not known.

So why does XCode not display anything?

Why this behavior? #

Well, by default XCode displays only the errors coming from the current target. In the current case my worksapce is composed of 4 projects:

  • An iOS project in SwiftUI (executable)
  • A macOS project in AppKit (executable)
  • 2 Swift Packages (not executable)

So I have 2 schemes : iOS and macOS. The error being present in one of the Swift Package, XCode does not display any error despite the fact that the build fails.

How can we change this behavior? #

But then how do you change that? Since I work on all these projects at the same time, I would like to have all the errors and not only the errors of the current scheme.

Nothing very complicated here, you just have to go into the project settings. To do this go to the File menu in XCode and select Workspace Settings... :

XCode: Workspace settings menu
XCode: Workspace settings menu

Et maintenant il faut changer Show issues for active scheme only en Show all issues :

XCode: Workspace settings
XCode: Workspace settings

From there you will see all the errors in your project.

All errors
All errors are now displayed

Nothing very complicated but you can easily spend some time there.

Sources #