XCode 14 compile errors immediately disappear or do not appear at all

I'm unable to use XCode 14 to develop my app because as soon as a compiler error is shown, it is immediately withdrawn from the Issue Navigator pane. This makes it impossible to see what is wrong. The errors are also immediately withdrawn from the editor.

This video shows 3 attempts to compile the project: after the first attempt no error shows, after the second attempt the error shows for a moment then is automatically removed (no mouse or keypress from me), after the third attempt same.

https://youtu.be/bmK_k6oLYpQ

I have tried rebooting, and deleting ~/Library/Developer/Xcode/DerivedData, to no effect.

Okay, I figured out what the problem was. Finally!

The key to figuring that out was to see how Xcode is actually calling clang/swiftc in the background, so you can call it yourself with exactly the same arguments and get the actual error message.

To get that information, you start Xcode in Terminal with sourcekit logging enabled

SOURCEKIT_LOGGING=3 /<path-to-xcode>/Xcode.app/Contents/MacOS/Xcode 2>xcode.txt

After you edited a source file, you can quit Xcode again and now the file xcode.txt contains the sourcekit log. When you search for the file you just edited, you will stumble upon an entry that shows how the compiler was called in the background

  key.compilerargs: [
    "-x",
    "objective-c",
    "-ivfsoverlay",
:

All you need to do is converting that into a command line call by removing the comas and making all arguments a single line, then you can call the compiler yourself with the exact same arguments and it will tell you what the issue is.

More details about all this can be found here: https://stackoverflow.com/a/75605312/15809

In my case it turned out that a module has not been found by the compiler because the "Supported Destinations" (General tab for a framework target) were not correct. During a full build that played no role as the framework was still built for all the destinations and the linker would then find the module file in the build target location which is added to the search paths. But when creating the command line arguments for live issues, Xcode relies on this information correctly reflecting platform dependencies and if the current platform is not listed there, the module map of the framework is not added to the arguments and then the module is not found.

I think it's really a pity that Xcode is not showing these kind of errors by default somewhere in the UI. If you use Visual Studio Code, which uses the same mechanism as Xcode to lint source code and it runs into a similar problem, it will show you the actual error message in its error console and you will know at once what needs to be done to fix that.

Having the same problem in a project that I'm supposed to update to be allowed on app store, so lots of warnings that appear, then disappear again just as I go to check them out. It's crazy-making. I tried deleting build data, caches and everything suggested here. Also deleted and reinstalled XCode and all dependencies to no avail. Finally downloaded the latest 14.3 beta 2, and the bug hasn't been fixed. This shouldn't be happening after bug was first reported 5 months ago!

This worked for me indexing was getting stuck, which caused compile errors to disappear https://stackoverflow.com/questions/13831559/xcode-stuck-on-indexing

FIXED !

At least for me.

I just had this same problem come up, with the errors not showing while editing, and then showing up for some number of seconds after attempted build and then disappearing. M1 Mac mini, all the latest software as of today 28 Mar 2023. I discovered it was only the project I was working on. Opening another project worked fine. I started a new project and copied all the text from the files in the problem project over. All good now.

I'm too new at this to know how to mark this as a solution to help others. Maybe someone has a moment to school me a little.

Xcode 14.3RC - same issue! What is going on, Apple? This makes it impossible to do any meaningful development. I have M1 MacBook Pro

I'm also experiencing this issue with Xcode_14.3_Release_Candidate.

Fixed!

Double check the capitalization of your project path vs your folder capitalization. When mine were mismatched (e.g. /Users/username/Git/Path/To/Project/Project.xcodeproj with a folder path of /Users/username/git/path/to/project/project.xcodeproj) I had this problem. Once I updated them to match the capitalization It worked.

In Xcode select the project (first item in navigation list), show the file inspector and look at where it says Full Path, then compare to your folder structure in Finder

facing the same issues

This super annoying bug came up after upgrading to 14.3. Project path is ok, so it must be something else.

Hello, I just upgraded from the release candidate to the 14.3 on the App Store, now I also have this issue.

Thanks

As Xcode 14.3 does not have running in Rosetta option, unchecking "Show live Issues" in Xcode setting at least prevents errors from disappearing.

10

Hello everyone!

I am glad to say that I have finally fixed a bug in our working project.

As some of you have mentioned earlier, the issue can arise when Xcode indexing fails, especially when the group filename in Xcode and folder name in the filesystem are different. However, I double-checked this and found that it was not the cause of our issue. So, I took the following steps:

  • I turned on the index log in XCode by running the following command in Terminal: defaults write com.apple.dt.Xcode IDEIndexShowLog -bool YES.

  • After that, I went to the log tab on the left bar and found the Index section. In the index log, I discovered an error that said the compiler couldn't find the Moya module for the x86-64 processor, even though it found it for the arm64. But I have an arm64 M1Pro chip. So, the reason it was trying to find the x86-64 version of lib was hiding in BuildSettings.

  • I found that I had set arm64 as excluded archs in BuildSettings when I had an issue with libraries that weren't ready to compile to arm64 sim. But now that all project dependencies are ready, I only needed to remove that setting.

  • And that's it! The errors are no longer hidden from me.

P.S. If you are using Xcode 14.3, you may also need to remove that setting because it no longer supports the Rosetta environment.

In short, to fix the issue, remove "Excluding archs: arm64" from the target BuildSettings.

I hope this helps!

Are any of you using a system with CrowdStrike Falcon running by chance?

It will appear in Activity Monitor as com.crowdstrike.falcon.Agent

The only thing that worked for me was to delete the DerivedData folder.
/Users/USER/Library/Developer/Xcode/DerivedData

in xcode settings > general uncheck the "show live issues"

XCode 14 compile errors immediately disappear or do not appear at all
 
 
Q