Using Xcode 9.1, after building an iOS app, I want to archive it and upload it to the appStore for beta-testing.
But I get the following issue after clicking the button Upload to the App Store... and choosing Automatically manage signing:
"My Name" has one iOS Distribution certificate but its private key is
not installed. Contact the creator of this certificate to get a copy of the private key.
I do not know why this "private key is not installed", but the Distribution certificate may have been created on a different computer or something. In any case:
What is the simplest way to retrieve the missing private key and install it? In order to make things work.
Up to date (January 2021) (Xcode 10 - 12)
Go to Xcode - Preferences - Accounts - Manage Certificates
Click on the + at the bottom left, then Apple Distribution
Wait a little, then click Done
That's all.
You may want to revoke the old certificate on developer.apple.com too.
Old answer
Step 1: Xcode -> Product -> Archives ->
Click manage certificate
Step 2: Add iOS distribution
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.
This answer is for "One Man" Team to solve this problem quickly without reading through too many information about "Team"
Step 1) Go to web browser, open your developer account. Go to Certificates, Identifiers & Profiles. Select Certificates / Production. You will see the certificate that was missing private key listed there. Click Revoke. And follow the instructions to remove this certificate.
Step 2) That's it! go back to Xcode to Validate you app. It will now ask you to generate a new certificate. Now you happily uploading your apps.
Add a new Production Certificate here, then download the .cer file and double click it to add it to Keychain.
All will be fine now, don't forget to restart Xcode!!!
EDIT: I thought that the other computer is dead so I'm fixing my answer:
You should export the certificate from the first computer with it's private key and import it in the new computer.
I prefer the iCloud way, backup to iCloud and get it in the new computer.
If you can't do it with some reason, you can revoke the certificate in Apple developers site, then let Xcode to create a new one for you, it'll also create a fresh new private key and store it in your Keychain, just be sure to back it up in your preferred way
People's answer here about having the key from the computer is generated are accurate. But if things are still failing, try restarting Xcode after installing a cert
revoke all distribution certificate for developer.apple.com and the validate your app in Xcode there will be the option to create a new distribution certificate after you can export key for further use.
This work for me.
Just for anyone else who goes through this, the answers above are correct but it can still be a bit confusing especially if you have multiple certificates. These were the steps that I took:
First take note of the date in the actual distribution certificate that is missing its private key. Then go to the keychain application on the other computer and type iOS in the search bar. It will show all of your iOS Developer and Distribution keys so you have to find the right one.
Click the right arrow of each iOS Distribution entry to reveal the certificate and find the one with the correct date and export that one by right clicking and selection export.
Then just import it in the keychain of the new computer and at least with Xcode 9.3 it immediately recognizes it and corrects the error so you can now upload your achieve.
If you are using the certificate in a new computer or not. The easiest thing to do would be to revoke the previous certificate relating to the project. Then re-upload to the store. Xcode will generate a new one.
In my case Xcode was not accessing certificates from the keychain, I followed these steps:
delete certificates from the keychain.
restart the mac.
generate new certificates.
install new certificates.
clean build folder.
build project.
again clean build folder.
archive now.
It works That's it.
i tried all mentioned solutions available on the internet but no solution working on my Mac, then i created a provisioning profile manually on apple developer website from certificates and identifiers. By importing that file manually app successfully uploaded on appStore follow below steps
On Developer website
1-go to this link https://developer.apple.com/account/resources/certificates
2- In profile Section create new profile by using app bundle identifier
3-Download it and save it an where
On Xcode
1-Go to Signing and certificates
2-Disable automatically manage signing
3- Select provisioning profile in its section
4- Archive the app
5-Click Distribute App ->ApStore connect ->Upload->Next-> Then Select Profile from XXXX-app section when it download it show inside this section and now upload it
Click on Manage Certificates->Apple Distribution->Done
In my case, after revoking the old certificate and creating a new one, Xcode was showing the same error (I've done a clean build and removed the derived data folder).
In that case, try to manually manage signing.
After that, check the second field and set the appropriate one.
Note: After uploading the build, I needed to wait for 15 min to see my build in the app store connect.
Adding to the above answers,
If you have admin access on this account create new certificate and use it to publish. I just did that and it passed.
1- Create new Certificate Signing Request (KeyChain Access > Certificate Assistant ) and save to the disk
https://help.apple.com/developer-account/#/devbfa00fef7
2- Login into your apple developer account > Certificates and Identifiers > Click + to add new certificate)
3- Upload the signing cert you created in step 1, click next and download the certificate
4- Double click the certificate to install it. Make sure it is trusted and showing "This certificate is valid".
5- Try to archive again now and choose automatic signing.
That should do it.
just click "manage certificates" -> "+" -> "iOS distribution"
go to this link https://developer.apple.com/account/resources/certificates/list
find certificate name in your alert upload then
Revoke certificate that
if you have certificate you download again
upload testflight again
If you are being stuck on this problem. After switch the computer and not able to upload your build to App Store. Simply click manage certificate on the error page, the + plus on the bottom left corner and create a new distribution certificate. Then you'll be good to go.
I am also facing the same issue in xCode (v12.4) and created two more distribution certificates but nothing get worked for me.
Solution : Restarting xCode seemed to do the trick for me.
I was facing the same problem with Xcode v11.3
Upgrading to Xcode 11.6 solved the problem for me
This can happen if your MacBook has a battery issue and powers out unexpectedly. Your date is reset to an old date and if you opened XCode, it probably recorded that date and that may have caused the signing issue with certificate.
THIS IS HOW I RESOLVED IT
Went to Settings and set the correct date and time.
Clicked on the XCode option on the top left.
Clicked on Quit XCode.
Restarted the MacBook.
I reopened XCode, archived my app and it had no issues with the signing certificate.
I hope it works for you. An upvote if it does.
I'm new to the Mac platform - using Mac OS X El Capitan and installed XCode few days back. There is this iOS Application that was developed by a freelance person and now we have the source code of that. I'm trying to generate an .ipa file by building & archiving the application but it's failing regularly with below error:
No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “E3NXR7ESXS” were found.
List of steps that I did to Build this Application:
Double-clicked on the .xcodeproj file, it opened the project on the XCode
Tried to Archive the Project but this icon was disabled so looked over the web and found that under the Menu Items select the Product
-> Destination -> Generic iOS Device (Since no device is attached to the Mac) and then the Archive option was available.
First clicked on the Build and it said the Build is successful
Second tried to archive it and it failed with the error:
No code signing identities found: No valid signing identities (i.e.
certificate and private key pair) matching the team ID “E3NXR7ESXS”
were found.
So I checked over the web and found many answers but I'm not sure
where to proceed as most of them talks about exporting/importing a
developer profile OR link the developer profile with the application
and since I don't have both so its a mess for me right now. Also there
are answers like deleting old certificates/profiles but when I checked
under the preferences there aren't any and nether any of my account is
linked with the developer profile.
The only thing that I want is to generate an .ipa file so that it can
be further used.
Note : My Mac is totally new, installed the latest version of XCode and after importing a project I need to Archive it to generate an .ipa file. Also there is no device attached
It's been a 2 days since I'm struggling in this. Please help me out or
give me a direction from where I can see the list of steps (like if I can generate a new certificates or link my account with this application) for what to do with the imported project and generate the .ipa file from it.
You need to get the private key from the freelance developer. The certificate can be downloaded from the apple developer site.
If they do not have the private key or you cannot reach them, you will need to generate a new certificate and private key pair to sign your application.
If you need to generate a new certificate, here is a good guide. Note, in order to not get in this same situation when the certificate expires or if your Mac dies, make sure you backup the private key from your keychain (select it and export it, save it to a network drive somewhere safe), and the cert signing request (.csr) file. The CSR will allow you to generate a new certificate that uses the same private key. You can always generate a new CSR from the private key, so the private key, usually exported as a .p12 file, is the most critical one to back up.
Note that if you invalidate a certificate, any apps built with the certificate will stop working.
my xcode version is 7.0.1, Now my client gave me their p12, .provision. Now i added all the under build setting. i want to generate ipa file to upload in app store. So i select first option in below image and i dont have my client developer account. So i choose "local assign assets"..After that my xcode getting quit automatically
My client gave me these files :
1.p12
2. projectname.mobileprovision
Does .cer is needed to generate ipa file to upload in app store.
Please help me !!1
The Keychain Access Window opens up. With the Keychain Access window open, go up to the Keychain Access menu at the top and select File and then click on Import Items. Another window will appear. In this window, you should browse to the .p12 or .pfx certificate file on your computer.
& After upload process...
Refer this tutorial and testflight app information...
http://www.raywenderlich.com/101790/ios-beta-testing-with-testflight-tutorial
https://developer.apple.com/testflight/
You can't create .ipa file when following issue arise.
1) if provisional certificate not made properly.
or
2) created provisional certi. and installed certificate is not match.
or
3) when proper team is not selected in project and target tab.
or
4) certificate make issue for Adhoc or developement (AppStore).
you can check what issue is in your end of given here.
I am trying to upload ipa on apple store but it’s giving me “ERROR ITMS- 90035 invalid signature” error.
I have followed below process.
The first step in setting up a distribution profile is to create a certificate signing request. You can do this on your Mac. Launch the Keychain Access.app that is stored in Applications/Utilities.
Then execute the following steps in yourKeychain Access application:
Select Preferences > Certificates and ensure that Online Certificates Status
Protocol (OSCP) and Certificate Revocation List (CRL) are set to Off.
Select Keychain Access > Certificate Assistant > Request a Certificate From a
Certificate Authority... and ensure that you do not have any of your certificates
highlighted, otherwise the Provisioning Portal will not accept your certificate request.
Enter your valid e-mail address in the User Email Address field. Ensure that the e-mail
address is the same as the one you used when you registered as an iOS Developer.
Enter your name in the Common Name field. Ensure that the name you enter is the
same as the one you used when you registered as an iOS Developer.
A CA Email Address is not required.
Select the Save to disk radio button and tick Let me specify key pair information,
if it is present.
Press Continue.
A dialog appears that allows you to specify where you would like the certificate signing
request to be stored.
Specify a location and select Save.
Press Continue.
The certificate is then generated and written to the file you specified under step 8.
After you have generated a certificate signing request, you need to submit your certificate for approval.
Log into the iOS Provisioning Portal that is accessible from:
https://developer.apple.com/account/ios/certificate/certificateList.action.
This link takes you directly to the Certificates, Identifiers & Profiles section of your iOs developer account. Select the "Production" tab and follow these steps:
Select the Add Certificate button.
Select "App Store and Ad Hoc" as type then press continue
On next screen press "Continue"
On next screen select "Choose File" and select the certificate you created in previous step and then press "Generate"
Remain on the same page as the one you were on when you submitted the certificate signing request, then follow these steps to download and install the certificate:
Download Generated certificate by clicking the "Download" button.
Double click the downloaded certificate to install (alternatively drag to the keychain utility)
It is important that you backup the keys you created. This allows you to develop on multiple Macs or reinstall the keys after unexpected data loss.
You can export your private keys and certificates through the Keychain Access application:
Open the application Keychain Access.app that is stored in Applications/Utilities.
Select Keys.
Highlight the private key associated with the distribution certificate.
Select File > Export Items.
A window opens that allows you to specify where you would like to save your certificate.
Select Personal Information Exchange (.p12) as file format.
Select the file name.
Select Save.
You are prompted for passwords that allow you to access the key in the future
This is the final stage and will create the distribution provisioning profile you need to use when building your iOS standalone.
Start by selecting the "Distribution" tab from "Provisioning Profiles"-
Select New Profile (+)
Select App Store as the Distribution Method.
Enter the Profile name.
Ensure that your Distribution Certificate has been created and is displayed correctly.
Select the appropriate App ID for your applicatoin
Select Generate.
Select the Download button from next to the Distribution Provisioning Profile you created.
This allows you to download the .mobileprovision file.
Double click the .mobileprovision install the Distribution Provisioning Profile on your computer.
This is the process I am using to generate ipa. Then I want to upload this ipa with application loader , But it’s giving me signing code error. Please see attached screenshot .
Please help.
enter image description here
There are several reason for such type of error comes.
First of all you need to refer this Troubleshooting Failed Signature Verification
After above guide, you need to check all steps which write in the images like .
1) Make sure you have signed your application with distribution certificate not adhoc or development certificate.
please check what certificate you have used? follow this link
How to tell what profile/signing certificate was used to sign .ipa?
or this link also helpful for you
Maintaining certificate
2) you need to check your codesigning portion(=>provisioning profile) that all certificate selected correctly or not and also check bundle identifier in plist.
Note:- you need to set it at both place -> project and -> target
and at last last check that in all process you have selected [IOS Device] in place of [Simulator]
to check full process please check Submitting an App to the iOS App Store (Xcode) this video.
I had emojis in some filenames in a React Native app. After removing emojis now everything works.
I've search the web but couldn't find a solution exactly for my problem. I've created a Development Provisioning Profiles in iOS Provisioning Portal and added it to my iMac. I can successfully deploy applications to my iPhone.
Now I'm trying to deploy the same application from my MacBook Pro. I've installed the profile but gets an error:
XCode could not find a valid private certificate/valid key-pair for this profile in your keychain
I think that I need a private key from my iMac which I have to import to my MacBook Pro. Right? My question is, where can I find that private key?
When you have generated your certificate, Apple requires you to use Keychain Access for generating a certificate signing request (CSR). When you've done this, a private key has been generated in your keychain.
You got the error above because you don't have transfered this private key between your Macs.
Here is the guide to do so (the link is for mac, but it's the same manipulation). From your iMac :
Open Keychain Access in the /Applications/Utilities folder.
Select the signing certificates you want to export.
Choose File > Export items.
Choose Personal Information Exchange (.p12) as the file format and click Save.
Enter a password and click OK when done.
Transfer the p12 on your macbook, and :
Double-click the exported file that has a .p12 extension.
Extracted from :
http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/OSXWorkflowGuide/CodeSigning/CodeSigning.html#//apple_ref/doc/uid/TP40011201-CH7-SW17
Revoke the current certificate then follow the prompts regarding keychain Access when you go create new and then you should be fine.
You can still use your keychain to create the CSR, and then upload it on the new provisioning portal. Just did it the other day.