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'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)

Sharing my experience: we had the issue starting this morning, with Xcode 15.4, on Sonoma. This is the machine we use for automated build and test.

After updating Xcode command line tools (from system settings), and removing the Derived Data, it seems to work properly.

Xcode 15.3 crippled with "internal inconsistency error"
 
 
Q