Internal inconsistency error (didStartTask)
Asked Answered
A

2

27

Sometimes, about 2 times out of 10, when I run my application through Xcode, I get this error:

Internal inconsistency error (didStartTask): targetID (174) not found in _activeTargets.
Internal inconsistency error (didEndTask): '12' missing from _activeTasks.

This error is reproduced using Xcode 14.x, 15.x versions.

This error can be fixed by cleaning up the project and rebuilding it. I found thread on forums.swift.org, but it has no solution.

Judging by the thread, the problem may be in SPM and incorrect connection of dependencies

Anyone have a solution?

Altostratus answered 14/4, 2023 at 11:49 Comment(9)
do any of your swift packages use a BuildToolPlugin?Maneating
@Maneating Yes, I use several BuildToolPlugins. But plugin work successfully and the error occurred at the time of planning the buildAltostratus
Also getting this error in the Xcode 15.1 Beta 3, though here it actually breaks the build process with a Build failed and has a more detailed message: Internal inconsistency error: received multiple target ended messages for target ID '1' or received target ended message but did not receive corresponding target started message, while retrieving parent activity in taskStarted message. and Internal inconsistency error: received multiple task ended messages for task ID '4' or received task ended message but did not receive corresponding task started message.Waggish
I'm using a local SPM package with the SwiftGenPlugin .plugin as wellWaggish
Still, the issue is on Xcode 15.0.1. I'm using SwiftGenPlugin.Batchelor
The issue is still present on Xcode 15.2Patronage
Getting this on 15.3 with R.swift SPM pluginSyncrisis
I'm still seeing this issue in Xcode 15.3 in a project that uses plugins: SwiftGenPlugin and XCStringsToolPlugin.Imbrue
It says on swift.forum: Creating a build pre-action script for the scheme that you use with killall XCBBuildService. This generally helps, but carries a big overhead and maybe even more problemsAltostratus
B
4

I am not at all sure if this will help, but I had a similar message today a bunch of times and found this question, then tried Product -> Clean Build Folder and that cleared it up for the rest of the day. Seems like it had to do with something I changed on an observable value and something didn't get rebuilt fully.

Benavidez answered 31/12, 2023 at 6:48 Comment(0)
A
3

In Xcode 16 Beta it seems to have been fixed:

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

Altostratus answered 10/6, 2024 at 20:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.