Xcode“这个 mac 上没有安装用于的私钥-分发”

我总是得到这个消息时,我尝试提交我的应用程序到应用程序商店。

下面是这条信息的图片:

picture

如果有人能帮我解决这个问题,那就太好了,这样我就可以向商店提交我的应用程序了。

88675 次浏览

It seems that you have got as far as generating a distribution certificate, so you must have generated a key pair at some point. Do you develop on multiple machines? Export the developer profile from the machine that has it and import it into this machine.

It is worth checking in Keychain Access to make sure you don't have multiple keys with the same name. Also, very often when I have run into Code Signing issues, the fastes solution has been to start the process over (create new keypairs, certs and provisioning profiles).

Best of luck!

It's simple, login to the user's account (maybe on different mac) which was used to create the distribution certificate. Open Keychain Access and export their private key. Then install it to your Keychain.

I've got the solution:

Your company has a Company (Enterprise Distribution).pem and CompanyEnterpriseDistribution.p12 you have to install them as well.

I also experienced this and fought the process for 4 hours. finally i did the following

  1. Deleted all the Private and public keys and certifications in my Keychain Access
  2. Deleted all Provisioning profiles
  3. Deleted all AppID's - (Probably didn;t need to do this by I wanted a clean slate)
  4. Deleted my certifications on the Developer.Apple site
  5. Created new Wildcard Development Profile
  6. Created new Profile SPECIFIC to the App that I was deploying (So it had the appname instead of *, in the AppID)
  7. Created a new development Certificate from the Website.
  8. Downloaded the intermediate certificate (Worldwide Developer Relations Certificate Authority) since I wiped that off my Keychain too
  9. Created the Certification Signing Request (CSR), followed the instructions to the letter to add it to my keychain access. and Uploaded the CSR.
  10. Once the Certification was added, I made sure to rename the public and Private Keys, and added comments to the info box - so I could remember what I did.
  11. Created a new Distribution Cert by repeating Steps 7,9, 10 for the Distribution so I could get it onto the App Store.

Hopefiully this helps someone to know that you can wipe everything out and start over. I loaded all the certs on an olf Macbook Pro that started flaking out last week. So I got a new Mac Air last week, but Icouldn;t remember what keys, and I certainly didn't remember I had 2 sets of Private and Public one for the Development, and 1 for the Distribution. (If you have more that 1 distribution, I believe you would have additional sets.)

Steve

This solved it for me without starting all the way from scratch:
1. Open Keychain Access on the machine that was used to generate the private keys
2. Select Keychains->Login and Category->Certificates on the left hand side
3. Locate the two certificates iPhone Developer: [your developer name] and iPhone Distribution: [your developer name]
4. Select both, right click and choose Export 2 items...
5. Enter a password of choice, save to disk and get the .p12-file over to the other machine that won't sign
6. Open the file, enter the password and you should be good to go.

this will happen because you have format your mac and reinstall it or you are developing from new mac .

if you can not do the above and have your old certicate and profiles exported from the old mac

you will need to remove the wild card provissioning profiles from apple developer center , and also from certifcates you have to remove the old ones just the general development and production certificates .

then you will have to create new ones and to create new provisioning profiles for the app you need to upload to apple .

you do not need to delete all the provisiong profiles for now , but for sure you will need to create new ones for apps that you do not create for it .

Try following these steps:

  1. Revoke your existing iOS Distribution Certificate from the iOS developer website.
  2. Generate a new iOS Distribution Certificate by going to XCode Preferences->Accounts->View Details and then clicking the + underneath the list of signing identities.
  3. Go back to the developer website and make sure all your provisioning profiles are configured with the new certificate. (They should all be listed as Active when you are done.)
  4. Go back to XCode and refresh your list of provisioning profiles.

I had the same issue as you did and this resolved it just fine.

My problem was Xcode was not on the Access control list for the private key. You can fix this in the keychain access without generating a new key pair.

Open keychain access. On the left side select login and My Certificates. Select your distribution certificate and double click your private key. Select access control and add Xcode to the list if its not there.

Restart Xcode and make a new archive. It should find the private key now.

I have a company account in apple. I solved the problem by:

1)in the developer website Certificates, Identifiers & Profiles
2)under Provisioning Profiles -> development
3)went to my development Provisioning -> edit
4)then download , and double click.

Try this..

  • In Your "System preferences" select "Security and Privacy".

  • Click on 'Lock' icon on bottom left corner.

  • Change 'Allow apps downloaded from' from "Anywhere" to "Mac App store and identified developers".

-Then try to build.

For those who are trying to update an app after some time, you need to renew your Porvisioning Profile in Apple Development Center, and then simply go to Certificates on the left hand side on your Apple Development Center, download the distribution certificate, and open it.

Xcode will do the rest and let you run the app.

Cheers!

For me it is that i have not installed my production certificate. (I have already installed development certificate which)

After downloading the production certificate and installed to key chain it worked for me.

This solved it for me without starting all the way from scratch:

  1. reGenerate file "CertificateSigningRequest.certSigningRequest" by other macbook.
  2. reGenerate Certificates "* Grid Information Technology Co.,Ltd"
  3. reGenerate Provisioning Profiles

I am building and distributing development ipa's for my beta iOS app. I have repeatedly had to add new devices to list of those allowed, and have had many woes created by this. This time I'm documenting and sharing such a problem and the solution...

I added a new udid to my list in the developer center, built an archive and found the ipa was not found in the profile embedded in the ipa. So, I refreshed my provisioning profiles in XCode (to get an updated list) and this error was caused with the private key missing (as depicted in the start of this thread).

I then couldn't build another archive. Further, this created code signing errors when attempting to build the project.

After much pain I fixed it like this:

In XCode, go to Preferences...Account Tab. Click the add button (middle left) and select "iOS Development". This will create a new signing identity.

You should now be able to use the new provisioning profile to create the archive.

Also, the build errors should be fixed. Back in the project, "General" tab, select the "team" and retry the build. There may be some additional permissions dialogs. Click "fix" or "always allow" when prompted.

Note: The Member Center and Key Chain list will become a mess, with duplicates for signing ids, but at least everything works. You may want to try cleaning it up...

I created a new Distribution certificate, then edited my existing provisioning profile to point to that new certificate, then in Xcode > preferences > account > view details I updated my signing certificates.

worked like a charm

I actually just closed and reopened xCode and then everything was back to normal.

Ran into the same issue and after cursing at Apple , I realized it was my fault.

1.- Go to developer.apple.com / Certificates / Production
2.- Download your certificate

This worked for me thank after trying other answers.

Go to Preferences -> Accounts -> Select the Apple ID you're using -> click "View Details…" button -> then click the plus button and select the "iOS Distribution" button. More details here.

I have another answer (in addition to my prior post). Today, my private key expired (as I found looking at KeyChain Access), and a new one was in the list. How? Idk... Maybe from using the XCode "fix the problem" button I was presented, or by pulling an update for provisioning profiles as I described in my other post a new one was created automatically?...

Anyway, I logged in the development center, found the provisioning profile I wanted to use and clicked "edit". I was then able to select "Certificates". I found that the one wanted was not selected. I selected it and clicked "generate" to recreate the provisioning profile. Then I was able to download it. I dragged and dropped the file onto my XCode dock icon. That fixed it!

Having a similar problem, after several days of testing, checking, try to repairing and so on, what worked for me was simply:

  1. Open Xcode's preferences (Accounts panel)
  2. Click on "Manage Certificates".
  3. Add a new certificate.

Then everything started working again.

enter image description here