xcodebuild: "error: …/build/Release/Defaults_Defaults.bundle: No such file or directory"

This is probably a beginner's mistake, but I can't find anything about this error anywhere, and it's completely reproducible, even on GitHub Runners and with a fresh Xcode project.

The error doesn't seem to be caused by the Swift package used, Defaults, but by xcodebuild.

When following Defaults' installation instructions, building and archiving from Xcode still works fine, but building with xcodebuild always fails with this error:

Copy /Users/user/DefaultsTest/build/Release/DefaultsTest.app/Contents/Resources/Defaults_Defaults.bundle /Users/user/DefaultsTest/build/Release/Defaults_Defaults.bundle (in target 'DefaultsTest' from project 'DefaultsTest')
    cd /Users/user/DefaultsTest
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/user/DefaultsTest/build/Release/Defaults_Defaults.bundle /Users/user/DefaultsTest/build/Release/DefaultsTest.app/Contents/Resources
error: /Users/user/DefaultsTest/build/Release/Defaults_Defaults.bundle: No such file or directory (in target 'DefaultsTest' from project 'DefaultsTest')

I made a fresh, reproducible Xcode project here: https://github.com/F1248/DefaultsTest

And a failing GitHub Action here: https://github.com/F1248/DefaultsTest/actions/runs/12303972248/job/34340347771

Any help would be greatly appreciated.

Your project is correctly configured. Building from Xcode and xcodebuild with your project should produce the same results, so please file a bug report and include your test project. Please post the FB number here once you do!

—Ed Ford,  DTS Engineer

Bug reported as FB16113784!

xcodebuild: "error: …/build/Release/Defaults_Defaults.bundle: No such file or directory"
 
 
Q