Xcode 15.3 crippled with "internal inconsistency error"

Since Xcode 15.3 it has become impossible to build our project more twice in a row without encountering a batch of "internal inconsistency error: never received target ended message for target ID …".

This issues appeared a few months ago (15.0 i think, but i'm not sure), but xcode 15.3 makes it almost unusable. We're a team of 3 iOS devs, and we're all having the problem.

Our project involves a lot of SPM packages, a few cocoa pods, a few iOS Frameworks, and a bit of swiftgen. Nothing particularly special for a large project, and no custom build steps that does anything fancy.

It is now to the point where we're looking for alternative to xcode, because we can't decently kill xcode and restart every time we have to build our code...

I'm seeing similar problems here. When adding a control in an XIB, adding an IBOutlet in ViewController (iOS, Swift), and running the app using "Product -> Run" with target "My Mac (Designed for iPad)" the new control is not there, and the corresponding variable is also not visible in the source code debugger. Looks to me as if the Xcode has not recognised the changes and did not recompile the source files. After doing a "Clean Build folder" the control is shown and the variable is also there. Earlier I also had to "Clean Build folder" after upgrading to Xcode 15.3, otherwise breakpoints did not work.

Same here. I use an external text editor (Emacs) to edit source files.

Before Xcode 15.3 I would get the "internal inconsistency error" every now and again. Now I get it almost every single time I return to Xcode and trigger a build.

As a result Xcode 15.3 is pretty much unusable for me.

I get the same error all the time. My workaround is just to build it again, and that seems to work for me every time. It's annoying to build twice when I'd rather just build once, but if it works, maybe this'll save you time over killing and restarting Xcode.

I can't believe Xcode 15.3 shipped in this state.

This is probably the buggiest Xcode release yet.

In our team, we have an impression the root cause is the number of Swift Packages we have,and keep adding. We have opened a StackOverflow issue, and also opened a post on Swift Forums

@SerjooA, I don't think it has to do with having many Swift Packages. I only have a single one in my project (SecretsManager, so a build tool plugin if that's any relevant) and I encounter this issue every time I build after having made some changes.

This happens to me with a project that uses a couple of external SwiftPM, no XIB files.

As described, every other build this gets triggered. Sometimes you get one error of that kind, sometimes, 4 or 5. A rebuild clears it, but is a lot of wasted time.

I'm also hitting this same issue--alternating builds failing with "internal inconsistency error."

I'm referencing a Swift package and "overriding" locally to point to a local checkout, but that's something that has worked in the past just fine.

I have a pure Objective-C project and I also get the XCode crash on every other build. (It is actually the second build because the crash puts one back at first build.) At least my code changes are saved! It appears to be one of the final seven or eight steps in the build process counter. These crashes happen whether or not the device is hardware or simulator, iOS 17.4 or 16.x or 15.x, etc.

Same issue. Xcode 15.3. Every second build is failing. Configuration doesn't matter, all of my projects, simulator/device, iOS 16/17.

I run into this every time I swap branches and my xcodeproj file changes in one way or another. I have to Resolve Package Dependencies manually every time.

I think this is related to the automatic saving file feature. I noticed that sometimes if i save the file manually and build, it completes correctly, but if i don't save the file and let xcode do it, it will fail on the first build, and then on second try succeed. This is so annoying to be honest.

I was getting this with some frequency prior to Xcode 15.3 in projects that had SPM build-time plugins. Now on Xcode 15.3 it's nearly every other build.

Same here. Still no luck in Xcode 15.4 beta

I had the same problem in Xcode Swift Playgrounds (v. 15.3). I was using UIKit/PlaygroundSupport and setting a UIViewController subclass to the liveView. That UIViewController subclass was defined in the main file (not in the Sources folder). When I made that UIViewController subclass public was when I got this error and the playground would run but the live view wouldn't show. When I removed the "public" accessor, that error disappeared and the live view started showing again. I know that this isn't the same type of project as the OP's, but I figured there might be something related.

I've never run into this issue until today. I was migrating from Apollo GraphQL to OpenAPI generator, both come from SPM. I removed every dependency to Apollo and added OpenAPI generator, runtime and urlsession packages. And now Xcode throws Internal inconsistency error every second time I try to build the project.

While writing this post, I remembered I had this issue last year or so. I solved it by re-adding the files Xcode was barking at. I'm going to try it now, maybe it will solve the issue I now have.

We've solved this by disabling our Swift Package plugins. Re-enabling them causes the issue to return. This works for us across different Xcode project files too. Seems pretty clear there has been some regression to the plugin system since Xcode 15.3.

The issue is present constantly Xcode Version 15.4 (15F31d).

Adding my experience using Xcode 15.4. Started getting these errors every other build after I added a Build Tool Plug-in from a Swift Package (SwiftLint to be specific). Soon as I removed it, the errors are gone.

Getting these errors with Unreal Engine and XCode as well. Never happened before.

@jonduenas is on the right track here. I started seeing this error today, and yesterday I updated my SwiftLint configuration to use the Build Tool Plug-in mechanism, rather than the Build Phase mechanism. This is almost certainly the cause of the issue (at least for me). Whether it's a problem with SwiftLint (currently using 0.55.1) or with Xcode, I can't say.

This is with Xcode 15.4, however I've been using the version without this error since it was released.

@jonduenas @Mcorey I can confirm our team gets the exact same error in our project when we use SwiftLint as Build Tool Plugin (which came as part of a package dependency that we have access to). After removal of the plugin the issue was resolved. We are using Xcode 15.3. Apparently the issue is resolved in Xcode 16 Beta according to https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes

Fixed an issue where projects using SwiftPM build tool plugins would sometimes report internal inconsistency errors when building. (121851192) (FB13565986)

Xcode 15.3 crippled with "internal inconsistency error"
 
 
Q