Xcode 14 live issues broken, shows false errors, but the real errors show only after build and disappear couple of seconds later

Hello, I have several extremely annoying Xcode 14 issues that completely destroyed my productivity. They've been hunting me for the last three or so months. I even searched the darkest corners of the Internet to find the cure, but although I found some solutions for people that had similar problems as mine, they unfortunately didn't help me at all.

I have a Swift UIKit project that targets iOS 13.0 and newer (only for iPhone), contains 3 schemas (dev, show and prod channels), uses swift packages with remote and local dependencies. No cocoa pods or something like this. Each schema only defines compilation conditions (so I determine in my code which channel I use), nothing more was affected in the settings. I also use a custom build script that only copies Firebase configuration file to the executable folder depending on project's schema.

Even though I tried my best by keeping the project structure as clear as I can do and not changing any other settings, leaving them by default as is, I'm still experiencing frustration, rage and sadness at the same time when I'm working with this project.

I encountered the first issue when I was using different Swift Packages depending on project's schema (for dev channel I used an autogenerated dev backend api and so on for show and prod - I wrapped them in #if #else blocks). I also updated Xcode at that time. So the problem was, I got a lot of in-editor error messages saying that Xcode could not find <some class> in scope, although the required package was already included in the file. And here comes the frustration - the project still successfully builds. I tried to solve this problem by merging these three packages into one and import them without #if #else tricks, but that didn't help. To make things even worse, autocompletion and code suggestion were broken for all imported Swift Packages - it doesn't matter if package was remote or local.

I tried to clean, rebuild, close Xcode, remove DerivedData folder, open Xcode in every combination I can imagine, but that didn't work, the problem didn't go away. After a couple of updates I also realized that live issues were completely broken. I didn't get any warnings and errors while coding. Only after building the project, real warnings and errors appeared in the editor and issue navigator, but only for three-four seconds, and then disappeared again. That drove me crazy. Tried to solve this problem with the same methods, it didn't help. Only after disabling live issues, the real warnings and errors did not disappear, but code suggestion and completion were still not working.

I enabled Xcode indexing log by typing defaults write com.apple.dt.Xcode IDEIndexShowLog -bool YES in the Terminal app. I found out that Xcode was not able to find one module:

&#x2F;somePath&#x2F;SomeFile.swift 0.2 seconds 
no such module &#039;somePackageName&#039;

This error appeared for every file I open and every character I type, but the error was pointing only at that specific file that actually imports that module. So I import this module (also added in the project settings), but still get an error that the module was not found, but again the project successfully compiles and runs. It is an Xcode Framework from a third-party developer that they provided for us. The framework contains binaries only for ios-arm64 and ios-arm64_x86_64-simulator. I use a glorious M1 Mac.

I decided yesterday to create a new project and copy there all code and resource files. I thought that I accidentally broke something in the settings and so I made them again from scratch. I did not had my Lightning cable this time, so I built the app for iPhone 14 Pro simulator. And the Xcode heard my prayers - everything was working great. The live issues worked as they should, I did not get any false errors and the autocompletion and code suggestions were fine. I got relief on that cloudy evening...

But that's too good to be true, here is the plot twist. I got today my Lightning cable back, connected an iPhone to my Mac. And now I got all these issues again 💀 So now it looks like these issues only happen when I select a physical device as a run destination. I discovered it while writing this post.

Any suggestions how to solve this?

Hi,

I have this annoying issue for one week. (Mac M1, Xcode 14.3)

Moreover, sometime, there are compilation issues but the app succeed to run (and crash) as if "continue building after errors" is checked (which is not) I did not show differences on simulator or real device My code work on a testflight build

However, I suspect a compilation error not shown which break source kit.

-> I tested my projet on my old intel Mac and it founds compilation issue : one missing self in a completion block and a missing import. After fixing these compilation issues, the intel Mac show live issues.

I thought this fix my issue on my M1 but it's still there...

did you found something [@Eugene Lutz](https://developer.apple.com/forums/profile/Eugene Lutz) ?

I have the same issue for a few days (Mac M1, Xcode 14.3). I managed to stop the errors from disappearing by unchecking show live issues (Xcode -> settings -> general -> show live issues). But it's not an ideal solution.

I also don't get any live issues. I think the problem appeared after the last Xcode Update (going to 14.3.1). I'm working on a M2 Mac mini (also using Swift UIKit), had no problems in the past and then suddenly live issues stopped working.

It is super annoying but I found out that this problem only appears when I have an actual device or the 'Any iOS Device (arm64)' as run destination selected.

-> When I select 'Any iOS Simulator Device (arm64, x86_64)' everything works fine.

I hope it gets fixed with the next update, as it is still annoying to switch between the run destination all the time.

For me "Any iOS Simulator Device (x86_64)" is the only option that works. With a real device sometimes works, sometimes not. My project has SwiftUI and UIKit views.

Xcode 14 live issues broken, shows false errors, but the real errors show only after build and disappear couple of seconds later
 
 
Q