I'm trying to start from scratch with all my keys for iOS development by deleting them, recreating them, and downloading and installing the new ones.
The problem is that I keep deleting the iPhone Developer: MyName certificate (no private key associated with it), but when I run Xcode, it generates a new one.
Is there a better way to start from scratch with all these certificates and profiles?
I had the same problem. I think if Xcode finds the old certificates on your iPhone or in any of the mobileprovision files for the apps in your organiser then it re-imports them.
try deleting all the provisioning profiles from xcode and from your iPhone. Eventually if you delete all references to the certificates it will stop restoring them.
XCode will generate one by default, that as you may see in the developer portal cannot be edited and says "Managed by XCode", you can use that one if you wish for testing, and then simply select the one you wish to use in your target code signing settings.
To start from scratch:
1) Delete and create a new certificate
2) Create a new profile with this certificate
I think I had the same problem recently. When you delete it you probably are in the Category 'All Items' in the Keychain Access tool. This means the the private key doesn't get shown/deleted. You should try deleting it from the certificates view. After I did that it never reappeared. :-).
edit: Seems to be a common problem ;-)
Related
I've been living the nightmare of trying to submit an app to the iTunes store... The newest massive waste of time is an error message that I get when I try to validate or distribute my archive from the "organizer".
The exact message is:
My Xcode is version 4.3.2. I'm pretty sure my WWDR is installed, because this has never been an issue before. I also tried to re-install it just to be safe.
The most frustrating/confusing part is that I JUST submitted my app successfully two weeks ago and nothing was changed. My app was rejected for meta-data reasons. I fixed those issues, re-installed one of my plugins, and now this.
Any suggestions? Even a link to some helpful documentation would be great. I've found the Apple developer docs extremely confusing and UN-helpful.
EDIT1:
I think I may have gotten closer to the problem. I changed some of the build settings and now my build fails with this error:
Code Sign error: Certificate identity 'iPhone Distribution: [my name]' appears more than once in the keychain. The codesign tool requires there only be one. I want to fix this but I'm not clear on which code signing profile should be set where. There are different settings depending on whether I click the "project" icon or the "target" icon and each of those has four different choices. Do all of these require code signing? Can anyone give me an example of a working configuration?
EDIT2:
I think I maybe found the problem. There is a small note that says my Distribution profile has no provisioning portal. I've been downloading and installing new .mobileprovision files but they all say "Developer". I think just need to figure out to download a new distribution profile.
SOLUTION:
Thanks to some pointers from Saad (see below), I figured out what was wrong. I was using the auto-select option for code signing, and the only distribution profile had an invalid provisioning profile. This happened very quietly, and I'm not sure why. I only noticed it when I went back into the provisioning portal to create a new distribution profile. After installing this, everything works.
your provisioning profile is not properly set
Code Sign error: Certificate identity 'iPhone Distribution: [my
name]' appears more than once in the keychain. The codesign tool
requires there only be one.
Open Applications > Utilities > Keychain Access and search for your Distribution certificate. Sometimes the Xcode Organizer decides to generate a new certificate for you and invalidates your old one, but does not remove it from your keychain. Remove the expired/older certificate and quit/re-launch Xcode (make a backup first, in case, by dragging to Desktop or Exporting). That should at least clear up part of your problem.
As for the provisioning profile, if that still is a problem, I'd manually go into the iOS development center and download the App Store Distribution Provision Profile for your app, removing all other provisioning profiles, until you figure this out. Quitting and relaunching Xcode when dealing with certs/provisioning profiles is something I've always had to do.
project identifier and your profile identifier must match
I have big problems.
I'm new on a small company and now I'm in charge of the iPhone developing.
Because I'm new and everything isn't clear on my work area (I had 7 Provisioning Profiles, for example), and I wanted to restart, so I opened the Keychain Access and deleted all Certificates, all My Certificates and all Keys.
Now I know it was a mistake I deleted my Keys, right?.
I went to Apple Developer Site and download all the Provisioning Profiles and Certificates, but I canĀ“t make it work.
When I try to debug on my Real Device, it shows me "Code Sign error: The identity 'XXXXX' doesn't match any valid certificate/private key pair in the default keychain" error.
After reading over the internet I think my problem was deleting the keys, right?.
I lost the key for the certificate, right?
What can I do?
The system's previus version is on the Apple Market, so I can't delete the certificate and create a new one, no?
I really need help. I'm new and this proccess is really difficult for me.
Thanks and sorry for my poor english.
You can savely revoke the certificates in the provisioning portal and recreate them with a new private key. This won't affect already released apps. After that just sign your apps with the new created certificates that match your new private key.
Just follow the steps on the "How To" tab in the provisioning portal if you get stuck.
I don't know whether I can help you, as I am also new, but still making a try ..
First, you yourself understand that you should not delete ALL profiles from keychain. But, you may, certainly, delete the profiles that get expired (it shows a small red cross on the profile name if it gets expired). Now, though you have deleted all from keychain, you CAN get them back. You must have a *.cer file as you downloaded all profiles from developer site. You also have a *.p12 file. On click on both to use the certificates. In one case, you will need to provide password (I don't remember which case, sorry). Put the password and you will find them in keychain.
Now, connect your device to Mac, collect also the information to the device using Organizer. To open organizer, go to Xcode->Window->Organizer. Here, click on Devices. On the left pane, You'll see 'Provisional profiles'. Click on it. Now you can see which provisional profiles are installed. Click on any one of them. Note the app identifier. It may be in this format 'ABCDEF.com.YourCompany.*' . Copy this part 'com.YourCompany.' and paste it in your code->info->Bundle Identifier (before $PRODUCT_NAME).
In build settings, now you'll be able to find the developer profile.
I mistakenly imported someone else's certificate(with his priv key) to my mac, and now I have two developer's certificates shown in my xCode. When I delete the unneeded certificate with its key in "Keychain Access", both the cert and the priv key magically reappear after sometime, how can I get rid of this? Is it automatically imported from somewhere e.g. the iphone developer's site?
Have you tried deleting from iPhone Configuration Utility app? It never comes back when I delete it from there.
EDIT: You can only delete provisioning profiles from iphone configuration utility app. To delete certificates/keys, you have to use keychain access.
Note that when you add a provisioning profile, all the associated certificates are added to your keychain as well. So deleting a certi won't help you, and it will always come back as in your case. All of them.
Here is a blog post that I had written for some code-signing insight. Here is a quote from this post:
Now, when you download a profile to your machine, all the associated certificates also get added to your keychain. You can check that under "Certificates" category in the keychain app. But unless there is at least one certificate with the corresponding private key in your keychain, you wont be able to sign the app.
Point is, it is the private key that xcode looks for for the certificates that you already have. Since you have a private key, xcode lists that as a available option for signing. So, its the private key that you want to delete and not the certi. So go to Keys section in the keychain access, find the culprit key, and shoot it.
XCode automatically does this if you log in on xCode with your developer's username and password.
It will generate a team provisioning profile and automatically download and install it.
To change it, go to the apple provisioning portal (http://developer.apple.com)
You need to open the "Keychain Access" app which can be found in the Utilities folder. In the "My Certificates" category, you will find all stored certificates on your machine and can easily right click and delete the certificate & private key.
I got another new account for the AppStore, I setup the new account certificates on my MAC. Now when I try to publish XCode gives me the error
CodeSign error: Certificate identity 'iPhone Distribution: 'Name' appears more than once in the keychain. The codesign tool requires there only be one.
How can I change my certificate identity for the other account? While I have to leave my Name as it is on both itunes profiles.
How can avoid this problem without have to remove one certificate each time I need to publish app on appstore.
Thank you.
Look in the keychain app on your Mac. You may have expired entries as well as current entries. Delete the expired entries and you will be okay. Worked for me today.
I create a keychain for each team, and put all the related files (public key, private key, certificate) for the team in the keychain. The only downside is that you have to set your default keychain to the team keychain when building for a device.
I have just had this problem, and my current temporary solution was to export then delete one of the distribution identities, leaving me with one identity which then XCode is happy with. So I will have to export, delete, and import each time I want to switch to a different project to make a distribution, which isn't ideal.
I am still looking for a nicer solution.
The keychain approach sounds ok in principle, but in practice it appears to be require using the "Reset the default keychain" option in Keychain Preferences, which I have not tried yet but doesn't sound like a low-risk activity.
I did publish multiple apps on multiple app store accounts using multiple certificate (for the same identity, aka "me") and Xcode manages to understand which certificate to use for which app so far (i may have to help him out by selecting the correct provisionning profile manually from time to time in the "project info" menu).
What i'm doing is to create a new certificate for every new "app store" account i'm working on, and of course never collide the app ids. That means my keychain is full of "iPhone developer - Ben (XDFUHSD)", "iPhone developer - Ben (DSUKJNSD)", etc... certificates, each beeing used for a different client.
Xcode does give me the error you mention from time to time, but it really only happens when one of my certificate has expired and i've just redownloaded a new one.
Hope this helps
For what it's worth, I got this error even though there was only one copy of the offending certificate in my keychain. The only odd thing about my setup was I'd added the keychain file from my 10.6 partition into Keychain Access, so I had two "login" keychains. Even though the other one didn't any certificates in it at all, the "appears more than once" error went away when I removed it from Keychain Access.
On the plus side, Automatic Provisioning seems to work pretty well these days, so clearing and reloading all my profiles wasn't the nightmare I'd thought it would be..
Finally got MGTwitterEngine stuff to
compile (by setting the Header Search Paths to /usr/include/libxml2 iphoneos3.0/usr/lib/libxml2)
AND link (by removing the Twitter LibXML Parsers code and assigning a weak role to libxml2.2.dylib in Targets: Link Binary With Libraries).
But when I do a Build and Go to the iPhone (not the simulator), I get this error:
"This provisioning profile does not have a valid signature (or it has a valid, but untrusted signature)."
I have followed the official Apple Developer process of getting a certificate and provisioning, etc. Obviously, I did something wrong somewhere. Has anyone come across this problem or have any ideas on how to solve it?
Things to check:
In Keychain Access, make sure you have a code sign identity (public and private keys and a certificate titled "iPhone Developer: Your Name"
In your Info.plist, make sure your Bundle Identifier matches your App ID that you created in the dev portal
Make sure you installed the .mobileprovision (from Terminal> open x.mobileprovision)
In the dev portal, make sure your provisioning profile has your certificate, your App ID, and your device all enabled. If it doesn't, fix that and re-download and re-install your provisioning profile.
Follow the instructions very carefully when creating your Certificate. One time, in Keychain Access, when I went to Request a Certificate, I had something else selected in the list panel and so it created the wrong kind of certificate. Make sure nothing in the list is selected when you do this part.
Restarting Xcode may also work... (Work for me couple of times)
Troy It looks like the issue is you don't have a keypair that is tied to the provisioning profile installed. It's tough to tell for sure but that is my best guess.
If that is the case, I've been working in a similar situation - what you need is to either generate a private key using the iphone development portal under the same account your boss used and then add that new key to the provisioning profile you are building with.
OR
You can get your boss to export the key he generated when he created the provisioning profile - he can export it from keychain and give it a password that will allow you to install it but protect it from anyone else installing it.
I guess the fifth time's the charm. I basically deleted the certificate and the provisioning file, etc., and started completely over. Viola! Now for those pesky memory leaks! :-) Oh, Java, wherefore art thou, Java? (and your majic garbage collection!)
One of the things that I tried and worked for me was to reset the keychain access
http://support.apple.com/kb/TS1544