"Command CodeSign failed with a nonzero exit code" I got this error

I'm using Xcode 15 , I'm working in at project "Command CodeSign failed with a nonzero exit code" I got this error

since Xcode 15.x - at first, once a week, now - EVERY day (every day I delete certificates and profiles...just to build a project....)

My issue was different than the others above and I've run into it a couple times over the years. During CI automation we run fastlane and ran into this mysterious Command CodeSign failed with a nonzero exit code. Both times the fix was to manually start up Xcode start building and then there would be a CodeSign pop up asking for credentials. It only occurs when setting up a new machine.

"Command CodeSign failed with a nonzero exit code" I got this error
 
 
Q