Another certificate mess

JamJarRiotJamJarRiot Member Posts: 62
edited November -1 in iPhone and Android Publishing
Ok, I re-installed my iMac some months back. Only now have I got round to needing a provisioning file. What a mess this system can easily become. I'm at a loss as to how to get my certificates working.
'A valid singing identity matching this profile could not be found in your keychain' is the message. I cannot get past this, no matter how much I try. In fact, trying too hard is part of the problem, although I've published an app top the App Store before with minimal fuss it's all become complete gibberish now and I need to step back and approach it after refreshing my mind. So...can someone tell me exactly what to delete if I want to start from scratch. If all my provisioning files are deleted, along with my certificates, what exactly should I have left to view in my Keychain Access program ?Provisioning files, certificates, keys ? In the Certificates folder, or in My Certificates folder, or both ?
If my personal keys are deleted, can you rebuild them yourself or do you need to contact Apple ?

Any help much appreciated

Comments

  • butterbeanbutterbean Member Posts: 4,315
    http://stackoverflow.com/questions/999313/iphone-app-signing-a-valid-signing-identity-matching-this-profile-could-not-be-f

    Certificates can be a real P.I.A and you're not alone.

    Look at this link, and you'll see below, from the #36 and below, several solutions people encountered. Sometimes it's not just one issue, see if any of these help, and sorry for your troubles!
  • JamJarRiotJamJarRiot Member Posts: 62
    Thanks Butterbean. Unfortunately I've tried the tips on that page, numerous times, and still stuck. In fact there are lots of such tutorials showing how to generate a certificate or provisioning file BUT... what happens when you've tried numerous times like myself and have generated x amount of profiles on your Apple dev centre (all of which stay there, un-delete-able !) and you just want to be back at step ZERO. The step just before you begin this bewildering nonsense, and have nothing generated.

    Perhaps if some people with a currently functioning certificate could explain what the prerequisites are to generate a certificate i.e how many keys are in Login/Keys (I have 4 now, should it be 2?)
    Should there be an Apple World Development, iPhone.Development and iPhone.Distribution certificate in Login/Certificates ? Should anything be in My Certificates? Should anything be in System/Keys etc ?

    A few screenshots of the above (with user names blurred out) and put into a sticky could really help out here, there are people coming unstuck with this every day, and I talk as someone who breezed through the process the first time around.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    i'm cross posting this from an earlier thread i replied to, so much of it probably doesn't apply, but if you're looking to start fresh, follow these steps:

    follow this guide step by step: http://gamesalad.com/wiki/developing_for_iphone

    if you still have trouble, remove everything and start over by following these steps (copied from another post):

    if you open up the keychain access application, you should see 3 certificates:

    Apple Worldwide Developer Relations Certificate Authority
    iPhone Developer: NAME
    iPhone Distribution: NAME

    If you expand both the iPhone keys, you will see two a private key with your name under each. Right click on each of those and hit delete. After that right click on the three certificates above and hit delete.

    Reboot your computer

    Then open xcode, with your phone plugged in, and click on Window->Organizer
    If you click on Developer Profile, you should see nothing in it
    Click on Provisioning Profiles, delete EVERYTHING
    Click on your iPhone/iPod Touch/iPad under devices, after a few seconds it will show you all installed provisioning profiles on the phone. Delete EVERYTHING

    reboot your phone and your machine again just to make sure it's all cleaned out.

    Now, go back and login to the iPhone Developer Portal and go to where you create your keychains/appids/provisioning profiles. Start from step 1, and read each section through twice before you do anything.

    If you follow the steps it's very easy, but you have to follow them exactly. If you make a mistake it's a nightmare.
  • JamJarRiotJamJarRiot Member Posts: 62
    Good clear instructions Jon, but still no go. I did exactly as above. No Provisioning files left on my system. As soon as I make the mobileprovision, download it and double click it to bring up Xcode, I'm told that Xcode cannot find a valid private key/certificate PAIR in the keychain for the provisioning profile I've JUST created. This error is shown when Provisioning Profiles is selected from Library in Organizer. Selecting Provisioning Profiles from Devices/MyiPod shows as empty. Is the lack of matching provisioning file on the iPod part of the missing 'PAIR' the error complains of ?
  • Rob2Rob2 Member Posts: 2,402
    You no longer have the matching private keys in your keychain...

    After deleting everything from your machine did you REVOKE your certificates in the iOS provisioning portal and generate new Certificate Signing Requests and download new certificates? Developer and Distribution
  • deltatracedeltatrace Member Posts: 10
    Rob. I revoked the certificates and generated them. I did everything slowly and by the book. Or so I thought, i've obviously missed some step along the way. I'll try all the above steps after another revocation and see what happens. Any other tips welcomed.
    Lord knows what Apple were thinking when they created this system. Hours, or potentially days to create a signing certificate, and all of 10 seconds for a user to jailbreak their system anyway....
  • JamJarRiotJamJarRiot Member Posts: 62
    Yep, tried all of this and still not working. Revoked and retried but same error as before. Will take a deep breath and retry above again.
  • entersimonentersimon Member, PRO Posts: 273
    I wrote this a few months back when I encountered your problem and found the fix for it. About a month ago I ran into the same problem again because of a new build on a new computer and referenced my own post and it worked the first time. Please, read it all the way through 2 times (really) before you start it. There are tiny little tricky things that can go wrong in the process, but if you do everything EXACTLY as it is written, you'll get out of that hole. Also, this is stated in the post, but when you download the certificates, don't double click them to install. You're going to do a drag and drop. Enough, here's the post:

    OK, I had this exact problem and have searched the internet far and wide for a clear description of what you should do to resolve this.

    I know this is an old topic, but I'm going to write this for the people who may stumble across this in their seemingly hopeless search for an answer.

    1. I'm sure there is another way to do this, but in all honesty, unless you're working with a TON of apps and are feeling too lazy to reassign a new certificate, just do this!

    2. I am really new to the dev center on apple.com and to xcode, so i'm going to write this out as thoroughly as I can.

    Obvious:

    READ ALL OF THESE INSTRUCTIONS BEFORE STARTING! THERE ARE A FEW TRICKY THINGS THAT SHOULD BE NOTED BEFORE STARTING! I TRIED TO MAKE THEM OBVIOUS IF YOU DIDN'T READ THEM ALL BEFORE YOU STARTED, BUT FOR SAFETY SAKE, read them all first.

    You need a paid developer account to put ANYTHING on your iphone/ipod/ipad through Xcode.

    Ok.
    first, go to your applications folder and open keychain access.

    Note that you can click on "login" and "System" words at the top left. This is vital to a later step, and to the next couple as well. You will need to unlock them if they are locked so that you can modify the content in each.

    find your certificates(all of them, the worldwide dev one, the developer one, and possibly another one with the same name associated with it as the developer) in login and system

    delete the bastards.

    If you try deleting them, and they still stay in the list, you will just need to reboot your computer and do it again. This was the most annoying part of my journey to understanding the solution, so enjoy this information. A reboot will fix that issue if it arises.

    Once all traces of those certificates are gone from the lists:

    Get rid of the keys associated with those certificates. They will probably have your name attached to them and you can find them by clicking on "keys" at the bottom of keychain access window and looking in either the login or system list. Delete them and delete them good. Remember, if they don't leave the list after you press and confirm your deletion, reboot and it'll work.

    IF YOU WORKED ON A DIFFERENT MACHINE WITH NO ISSUES AND THEN SWITCHED TO A NEW MACHINE AND EVERYTHING WENT HAYWIRE, THEN THERE WILL BE NO KEYS TO DELETE. THIS IS WHERE THE PROBLEM HAS BEEN FOR YOU. DO NOT WORRY! WE WILL CREATE NEW KEYS TOGETHER AND WE SHALL BE HAPPY!

    Using SAFARI

    Using SAFARI

    Using SAFARI

    (using safari is important because you will come across a needless error while trying to upload your certificate request otherwise. This was one tidbit of information that saved me from tearing all of my hair out as I tried time and time again to submit through Chrome.)

    go to developer.apple.com and sign in and go to the ios portion of the dev center.

    go to the ios provisioning portal on the right hand side of that screen.

    click certificates, and REVOKE the current (and problematic) certificate.

    click Home on the left hand side.

    click on the "Launch Assistant" button under the "Get your application on an iOS with the Development Provisioning Assistant" headline towards the bottom of the screen.

    Go through and follow all of the directions.

    It will tell you to open up your applications folder and open keychain assistant.

    at the top of your screen (next to the apple symbol, while the keychain access window is active (hey, i said i was going to make it easy for beginners) click on the words "Keychain Access"

    click certificate assistant

    click Request a certificate from a certificate authority.

    fill in your information and then click saved to disk. and continue.

    follow the steps to create the request file and save it to your desktop (which is default, so you will probably just need to say ok)

    go back to your SAFARI window, and it will be asking you to choose the certificate request file.

    choose it from the desktop and continue through the assistant until it's complete.

    you have created the necessary public and private keys while creating the certificate request. SO YOU HAVE KEYS! YAAAAY!

    next step is to download the WWDR intermediate certificate and your newly created development certificate.

    Both of these can be found in the "certificate" tab on the left side of your screen. The WWDR is shown as a link under the development certificate list.

    Download them and DO NOT CLICK THEM TO AUTOMATICALLY INSTALL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    This is where you will get into stupid trouble and think, I DID EVERYTHING RIGHT! I DID WHAT YOU ASKED OF ME AND STILL THIS DOES NOT WORK!

    Here's the trick. The final piece of the puzzle.

    Open your downloads folder and find the downloaded files.

    Open Keychan Access (if you closed it) and find the keys that were created while making your certificate request. They will be either in the login or the System list. Don't forget to unlock the lists if necessary.

    Drag and drop the downloaded certificates INTO THE LIST WHERE THE KEYS ARE!

    If you drag and drop them into the other list, the keys will have no idea that you did that, and they will be lonely forever and you will feel your chest tighten up and the rage of the unknown boiling from your gut.

    If you dropped them into the list that contains the keys, then you will notice a little drop down arrow to the left of the iphone developer certificate you just dropped in there. Click it and revel in the beauty of a key hanging out with its long lost friend.

    THAT'S IT!

    Now when you make a new mobile provision through the ios portal, and link it inside there with your newly created certificate, everything will be copacetic inside Xcode.
  • AppsRacKAppsRacK Member Posts: 346
    Just experienced this recently after i came back from a month of vacation. Surprisingly when i came back my iMac have encountered booting problem and i've tried everything i can to restore it (too bad coz i lost the copy of my time machine also) but i ended up reformating it.

    So after reformating the problem of certificate and provisioning arises. I've searched the net and follow some instruction on some forums and I've finally found a solution. Heres what i did:

    1. First you need to delete all the provisioning profile in xcode organizer & certificates you have in your keychain access. This will clean up everything you did before but didn't work out. After that restart your mac.
    2. Then you need to revoke your certificate in the apple dev center.
    3. Then follow the instruction on how to get a new certificate using keychain access. You need to do this as you would not get any keys (private & public) if you would just download the previous certificate and installed it on your mac.
    4. Upload the new certificate you just save on your desktop to apple dev center.
    5. Next You need to modify all of your provisioning profile in apple dev center coz it will have a invalid status since you revoke the original certificate.
    6. refresh your browser and download the DISTRIBUTION cerficate and drag it to xcode. You should not have the yellow warning in the organizer. If you have a yellow bar warning it means you mess up something in getting the certificate.
    7. If all works well publish your game in GS and you wont be having a invalid binary error when you upload your app on itunesconnect.
    8. If it's a success be sure to export your profile in organizer so that if you encountered problems again you have a backup of your working setting.

    Hope it helps.
  • JamJarRiotJamJarRiot Member Posts: 62
    Thanks all for the suggestions. Im not at my dev machine right now but I'l have another go later this morning.

    @ drahc: Not being at my machine, I wonder if you could add some detail to step 6. When you say drag it to Xcode, which window/slot exactly? This might be obvious when I'm sat using Xcode but I really want to double check every step.

    Thanks again.
  • AppsRacKAppsRacK Member Posts: 346
    @jamma

    Drag it to the Xcode icon and it will automatically open the xcode organizer.
  • JamJarRiotJamJarRiot Member Posts: 62
    Hey drahc, one final detail....in step 6 you say drag the DISTRIBUTION certificate...is this for a Distribution only release or can we substitute that for Development for private iPhone device testing ?
  • AppsRacKAppsRacK Member Posts: 346
    You can do this in development provisioning as well for device testing just make sure you choose the correct provisioning. Another thing to remember, when you modify the DISTRIBUTION provisioning in apple dev website be sure DONT CLICK the select all device at the bottom part as it will mess up the provisioning and will coz your binary to be invalid. Happens to me last night when i submit my update.

    good luck.
  • JamJarRiotJamJarRiot Member Posts: 62
    Pleased to say I got this sorted yesterday. It took a combination of around 3 different 'guides' inc those on here. So many different and undocumented,almost secret options. A major thing seems to be the dragging of certificates into the Keychain utility. Anyway I merged all of these different ideas and tips into one text doc. I'll format it and tidy it up and post it should anyone become totally stuck like I did.

    Thanks for the help. Nightmare over until next time.
  • AppsRacKAppsRacK Member Posts: 346
    glad to hear you've work things out.

    Good luck.
  • elpuercoelpuerco Member Posts: 1
    I had the very same issue and I fixed it by deleting EVERYTHING certificate wise from my MBP and on the provisioning portal and started again from scratch.

    The only concern I have is where it said when I deleted the distribution certificate that "existing apps will continue to work until it expires"?

    Does this mean that anyone who has downloaded an app free or otherwise will find their app not work once that expiration date comes round and no distribution certificate on my provisioning portal matches what they have on their device????
Sign In or Register to comment.