I recently installed latest Xcode 11 update and iOS 13 on my iPhone device. When I started the the device it said code sign wants to use a keychain key and asks me for a password. I tried my usual passwords but with no luck - the passwords don't work. I have used the iPhone device before many times, so I'm confident it has something to do with my recent updates.
I tried accessing my keychain, and found the key in question, but there is no way to look at passwords for keys, this is only available under the password category as far as I know. I took a look under the passwords to see if there was something associated with Xcode or the key. I tried a few but with no luck.
So what's going on here? What password does the device want? How do I get a hold of it? If that can't be done, is there some way I can just reset the device and start from scratch with certificates and such?
Ok, solved it on my own. Posting here if someone runs in to the same problem. Anyway, in keychain I deleted the certificate, then in Xcode there came an immediate error under signing and capabilities saying that the certificate was missing. There was a button called revoke. I pressed it and the certificate was added agin to keychain. I ran the app on the device again asked me again for a password. This time the password worked and I could get access to the device.
Honestly I have no idea what the issue was or why it was solved this way, but there you go.
Related
Every time I try to generate a certificate, I get this error. I have restarted the computer and it is still happening. I have no ideas what to do.
I'm running MacOS 10.15.5 on a 5k iMac. I have never had this issue before.
In the Keychain Access window, make sure you don't have any of the private keys selected. I'm not sure what the interaction is, but it changes what you are requesting from the authority as you can see by the menu text changing:
Because Xcode 10 simulator issue I had to reinstall my MacBook.
I didn't export my private key (Didn't think it was necessary, big lesson learned now).
I reinstalled Xcode 10, cloned the iOS App from Bitbucket. testing code. all good.
But I got "missing private key" error when I did "Validate App", which is one of my steps in submitting new App version to App Store.
This is the screenshot
This is what I have tried:
Goto Keychain, removed the key generated for my developer account.
Then back to Xcode, revoke certificate.
But it only brings me back to where I was.
Can I somehow create a new key to replace this one I created on Sept 10, which has been lost during the machine restore? Thanks
Ok. I figured it out after gone through several other threads.
Basically just one thing needs to be done: Go to your apple developer account online, go to certificates and profiles, find your certificate in iOS production, REVOKE it.
That’s all. Then during the validate process you will be prompted to generate a new certificate. Everything back to normal.
On a new mac, I installed xcode and needed to set up provisioning for a hello-world project to deploy to my iPad.
NOTE: I am using the new FREE provisioning (do not have a paid Apple account)
I went to Preferences/Account signed in to my Apple account
In the project, General tab, Team is set to my (free) Apple Dev account. (all seemed well, it recognized this as valid)
I tried to deploy to the iPad and I got a build error "codesign failed with exit code 1"
Supposedly this is to do with certificates. I went to Keychain Access and found "iPhone Developer: my#email.com (...)" in there, which was added when I signed in via my Apple Account.
I DELETED this key (thinking I would simply re-add my Apple Account and thus this key)
I then removed and re-added my Apple account from xcode preferences
I can sign-in, I can see it adds keys, and Keychain Access Get Info on the keys indicates no issues (valid, etc)
In xcode Preferences, when I click Manage Certificates, it shows "David's MacBook Pro (2)" and a bunch of "Untitled" keys ALL of which have a status of "Missing Private Key".
xcode/General/Status section says "The username or passphrase you entered is not correct" even though my "Team" is signed in and valid
Clicking "Try Again" shows "Waiting to repair", followed by "revoking...", followed by "Generating certificates" - which sounds promising, like it's doing exactly what I need, but then fails, private keys still missing, and back to step 9 here in a loop of hell.
ok? How do I get this resolved without flattening my OS back to factory and starting completely over?
Note: there are resolutions on SO that talk about Revoking the keys and generating new private keys from the Dev Console, like this one:
How can I add private key to the distribution certificate?
HOWEVER, on a "free" account I have NO access to the Certificates section! I can't manage anything from the Dev portal online. I do, however, see xcode specifically set up to handle certs (see step 9-10 above) but it is not working. I really don't know where to go from here. I'm new to all things Mac and iOS and xcode. Frustrated. Thanks Apple, so much for a simple on-boarding experience on a simple hello-world app.
After two bounties for this question which gave no results, I managed to find a solution to this problem.
Apparently, it was some keychain related problem.
To fix it:
Open Keychain Access on your Mac.
Right click on the "login" keychain in the left side of the window.
Press Lock keychain "login".
Then do the same to Unlock it.
Go back to Xcode and try to set your app to run with your personal account.
Solution was found using the first comment here:
https://github.com/desktop/desktop/issues/3625
I had this error and it occurred because I had moved to a new Macbook. Although there was a provisioning profile on our Apple account and it was not expired, the private key was on the old Macbook. So downloading and installing the profile did not help, as it was the private key that was missing. I revoked the provisioning profile and created a new one. I had the same issue for the distribution certificate.
If you are concerned whether revoking and creating new certificates/profiles will affect existing deployed applications, take a look at this question and the answers. The bottom line is, for applications on the app store it will have no affect, but for Enterprise Distributions, deployed applications will stop working if you revoke the provisioning profile. So if the application is on an Enterprise Account, then it is best to try find the private key in the keychain of the Macbook where it was created.
after 6 month of break I try to finish my first app.
After I downloaded the new XCode and the new SDK (I needed it, because old XCode and SDK was 4.3, my iPhone was on 5.0.1) I try to build, but it told me my signiture was to old.
So I cleared all things I have found in my keychain: certificates, keys and so on.
I remember that it is a really really mess, but I tried the last 5 hours withour writing a single line of code...
At the moment I created a new certificate in the Apple Online Portal.
I downloaded and double click it, so it's in the Organizer now.
The error from XCode when try to start on my device is now:
There are no valid certificate/private key pairs in the default keychain
Can someone help me? (Skype would be nice), I am really lost in this after 5 ours of triend all I found on google and get very very lost.
When you are installing certificates first time you will have to install "Apple Worldwide Developer Relations Certification Authority".
Check whether it is available in the system tab of keychain access.
If you double click the certificate and provide password, it may be possible that it gets added to system tab. So make sure it is added to the login tab.You can just drag and drop the certificate from system to login.
In xcode organiser window you should see the provisioning profiles. If you don't see your profile there install the profile double clicking it. Also check profiles' expiry date.!
Hope this Helps!
I know there are other questions that are very similar to this, but their symptoms aren't quite the same as mine.
I have an app that I've been trying to submit to the App Store. I was running Xcode 3.2.6, and I kept getting an Invalid Binary error from iTunes Connect. I eventually found an answer that points to upgrading Xcode, so I downloaded 4.2.
Now the problem is that Xcode won't recognize the distribution certificate that I used for the provisioning profile. I tried adding the profile and it gives the error message in the title. Also, if I try the Automatic Device Provisioning, the Distribution profile disappears completely.
This has been causing me some trouble for quite some time now. I know I have the Distribution certificate in my Keychain, so I think that Xcode is having a hard time seeing it for some strange reason. If you have an answer, please give it. If you need more info, go ahead and ask. I just need to find a solution...
EDIT:
I'm thinking of diving into the project file through text edit and manually adding the distribution profile. At the part that says PROVISIONING_PROFILE = "", what do I put between the quotation marks?
It sounds like you might not have the private key that you used to generate the certificate with Apple originally. If you have the private key installed when you open keychain access and click on certificates there would be a disclosure triangle you should be able to drop down and see the private key for that certificate like so:
If you don't have this key you need to delete the certificate you currently have, go to the iOS provisioning portal, revoke your current certificate and create a new one. The whole process shouldn't take more than 10 minutes.