missing private key in the distribution certificate on keychain
Ahh this is a common issue, The solution is simple:
Who ever created the developer credentials originally needs to go to the keychain on their computer and right click on the key(s) for private and public and export the key to a file.
Then you just download that file on your computer and open it, and it will be added to your keychain.
You need to have both the private key (.pem file) and the certificate for your provisioning profiles.
Apple Distribution Certificate - Missing Private Key on Computer that Generated the Request
Upgrading xCode fixed the problem. I was on 11.3.x and upgrading to 12.5 completely fixed the issue. I then ran into app bundle id issues (which were easy to fix), which makes me think perhaps xCode was just giving me the wrong error message. Regardless, upgrading fixed the problem.
Distribution certificate / private key not installed
You can only have one distribution certificate. It unites a public key, known to Apple, with a private key, which lives in the keychain of some computer. If this distribution certificate was created on another computer, then the private key is on the keychain of that computer. And this distribution certificate does not work without it.
So to use this distribution certificate on this computer, you must find that computer, open Keychain Access, locate and export the private key, mail it or otherwise get it to this computer, and import it into the keychain of this computer.
If you go into the Accounts pref pane in Xcode and double-click your Team, you'll see a dialog that gives you help with this. If you see your distribution certificate and it says Not In Keychain, you can control-click that certificate to get a menu item that lets you email whoever created the certificate and ask them to send it to you. That person can use this same import to choose Export Certificate and can email you exported certificate.
Either way, the private key or exported certificate will be passworded. You'll need to know the password in order to use it.
Related Topics
What Does "@Private" Mean in Objective-C
Code Sign Error:Bundle Format Unrecognized, Invalid, or Unsuitable
How to Send Data Back by Popviewcontrolleranimated for Swift
Xcode 8 :Function Types Cannot Have Argument Label Breaking My Build
Ios9 - This Application Is Modifying the Autolayout Engine from a Background Thread -- Where
How to Change My iOS Applications' Entitlements
Converting Between Nsdata and Base64 Strings
App Rejected Because of Advertisingidentifier in Facebook Sdk and Flurry Sdk
Change Text Color of Items in Uiactionsheet - iOS 8
Core Data: Do Child Contexts Ever Get Permanent Objectids for Newly Inserted Objects
Gradient Polyline with Mapkit iOS
What Does Deployment Target Mean
Swift Error:Signal Sigabrt How to Solve It
How to Change the Font of the Back Button for My Navigation Bar
Calayer with Transparent Hole in It
What's the Difference Between "Architectures" and "Valid Architectures" in Xcode Build Settings