Please check following thread, it has same issue.
Post
Replies
Boosts
Views
Activity
I think this is related to argument size in ExtractAppIntentsMetadata step. If relocating the project does not work, you can try to rename your Derived Data path into shorter name via Xcode > Settings > Locations > Derived Data (Advanced...). Although, I hope Apple fix the issue instead, maybe move the --source-files and --swift-const-vals argument into a file list.
For those who does not use AppIntents.framework in your application, you can add the following build setting to your project. It will prevent AppIntents.framework to be automatically linked and the build system will skip the Extract App Intents Metadata step completely. I have not completely tested the impact, but the build succeeded after adding the following flag.
OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -disable-autolink-framework -Xfrontend AppIntents
Some updates regarding the issue: I've reported this issue on Feedback Assistant months ago. I checked it again today and found out they added the fix on Xcode 15.3 beta. I've tried to build with Xcode 15.3 beta 3 and I can see ExtractAppIntentsMetadata command is much shorter now.