I was having the same issue since last night and finally got it to work just now. Had to go through this process
-
Logged in on https://developer.apple.com> > Certificates, Identifiers & Profiles > Provisioning Profiles and revoked my company’s Distribution Certificate.
-
Then Xcode > Preferences > Accounts > Apple IDs > (my company) > View Details and refreshed the certificates and Provisioning Profiles. It prompted that no Distribution Certificate was found on the Developer Profile and offered to request one on my behalf, which it did.
-
Launched Keychain Access > Certificates and removed all of the expired Certificates (somehow I had a few of them)
-
I went back to https://developer.apple.com> > Certificates, Identifiers & Profiles > Provisioning Profiles and edited all of my manually managed Provisioning Profiles (Development — which had to be re-generated — and Distribution — which had to be linked to the newly created Distribution Certificate and generated again)
-
Once again Xcode > Preferences > Accounts > Apple IDs > (my company) > View Details and refreshed the certificates and Provisioning Profiles.
Credit to Rodrigo on the apple dev forums