XCode: Build failed without any errors 🤔
Table of Contents
It’s all in the title: have you ever had this problem? It’s still very strange. And it looks like this:
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.
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...
:
Et maintenant il faut changer Show issues for active scheme only
en Show all issues
:
From there you will see all the errors in your project.
Nothing very complicated but you can easily spend some time there.