It sounds like you’re trying to use Developer ID signing for day-to-day development. That’s something I recommend you avoid. Rather, use an Apple Development signing identity for development. For background on this, The Care and Feeding of Developer ID.
Having said that, I can help you debug this specific problem. I recommend that you start out by isolating this from Xcode. If you run these commands, what do you see:
% cp /usr/bin/true MyTrue
% codesign -s "Developer ID Application" -f MyTrue
Run these from Terminal, logged into the same GUI login session as you’re using for Xcode.
If that prints a no identity found message, what do you see when you run this command:
% security find-identity -p codesigning
Policy: Code Signing
Matching identities
…
11) ADC03B244F4C1018384DCAFFC920F26136F6B59B "Developer ID Application: Quinn Quinn (SKMME9E2Y8)" (CSSMERR_TP_CERT_EXPIRED)
12) 3F8BE319780F84EB2E94ABDFA24E8045A0572A7B "Developer ID Application: Quinn Quinn (SKMME9E2Y8)"
12 identities found
Valid identities only
…
4) 3F8BE319780F84EB2E94ABDFA24E8045A0572A7B "Developer ID Application: Quinn Quinn (SKMME9E2Y8)"
4 valid identities found
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"