Warning when archiving product in Xcode with AppIntent extension

When building my app for debugging in Xcode I don't get any warning, only when archiving the product:

MyIntent.appex is an ExtensionKit extension and must be embedded in the parent app bundle's Extensions directory, but is embedded in the parent app bundle's ../../../BuildProductsPath/Release/MyApp.app/Contents/Extensions directory.

The MyIntent.appex is listed in the main target's Frameworks, Libraries and Embedded Content section and its Build Phase Embed ExtensionKit Extensions with Destination ExtensionKit Extensions. The extension also seems to work, since the app intent is correctly listed in the Shortcuts app.

Is this an Xcode bug or do I need to do something different?

I've also been seeing this issue since Xcode 14.3. I believe it's a bug in Xcode's embeddedBinaryValidationUtility tool. They changed the structure of the build directory in some odd ways and introduced symlinks but never patched embeddedBinaryValidationUtility.

Occasionally this warning turns into a compiler error when trying to archive the product. Then only deleting the DerivedData folder, restarting Xcode and archiving again turns it into a warning again.

Warning when archiving product in Xcode with AppIntent extension
 
 
Q