New Build System Error - missingWorkspaceContext

When building a large iOS application with a shared scheme in a workspace in Xcode (latest, Xcode 9.2, 9C40b) using the new build system, I started seeing this message:


Verify final result code for completed build operation
Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.


Nothing I seem to do can make it go away. I tried restarting, cleaning, wiping derived data - nothing wanted to work. In the console I see this warning that seems to be related:


unable to create build operation: Error Domain=com.apple.xcbuild Code=2
"unknown error while handling message: missingWorkspaceContext"
UserInfo={NSLocalizedDescription=unknown error while handling message: missingWorkspaceContext}


Curiously, every time I try to build and it fails, the error code increments with the rest of the text remaining the same.


We have a large project that contains a couple dozen subprojects. Because it gets a little hairy to manage, we created a workspace that flattens and organizes things a bit. The new build system works fine on any of the projects individually, but NOT from the workspace, which most of our developers work from.


Are there any verbose logging options or something I could turn on to help get to the bottom of this? xcodebuild seems to work fine with the workspace and doesn't produce this error - just the IDE.

Replies

I had a similar error when I updated to xcode 9.2 and macOS 10.13.2, and I solved it by downgrading my cocoapods from 1.3.1 to 1.2.1.

Hi dflems,


We are also facing same problem here. We have a huge project with around 3900 files in Build Phases > Compile sources.


Whenever we faces this Zombie error, we used to shorten the file paths and project is maintained at the root directory in order to shorten file path and it was working. But its all temporary solution. Now we reached to a level where nothing else works and we need to have permanent solution to the same.


Possible reason is, maximum limit on number files by Xcode. Only then this probelm can occur.

And I'm not using any cocoapods in our Project as well.


Any solution please suggest.


XCode version : 9.4.1

MAC OS Version : 10.13.6


Error:


Verify final result code for completed build operation


Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons.

One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem.

Some individual build task failures (up to 12) may be listed below.