Every time I logout and login to my remote mac, I get this error upon Archive:
The identity 'XXXX' doesn't match any valid, non-expired certificate/private key pair in your keychains.
Each time, I need to request new certificate, update all my provisioning profiles on itunes connect website, and rebuild my app.
Since quite recent time, this wasn’t an issue for me at all.
But now I need to do this upon each login.
OK, I figured this out.
While in keychain, select from login-certificates the certificate that’s known to work with your profiles.
Choose File->Export Items.
It will ask for password of your choice. Provide it, and save the file as .p12 in your favorite location.
When logged back in, launch keychain.
If your certificate doesn’t show up in keychain under login-certificates, do this.
password. Enter the one previously specified.
appear, with a dropdown arrow. Clicking this arrow will show up the
private key. Only such certificates are valid ones, and the reason
for the error is precisely because it doesn’t find your private key.
you specified should show up as valid now. Archive your app, and
there will be no error.
Note:
Same method can be used when you need to transfer your development to another mac too. Just performed the steps after logging back in onto target mac, with p12 exported file taken from source mac.