3

I am trying to Ad-hoc distribute my app. However, when I archive and than try to export it I am getting following screens: enter image description here

On this screen, when I click "Manage Certificates" button, I get following screen: enter image description here

I tried to regenerate provision profile on Apple Developer Portal. I generated and downloaded Mobile Provision files and tried to export again the app but I am received the same missing private keys error.

UPDATE I tried to manually sign my app. When I choose "Download Profile" from 'Provisioning Profile' it gives me following output screen:

enter image description here

Thanks

Val Nolav
  • 908
  • 8
  • 19
  • 44
  • I cannot access my old certificate. I do not know where it is. – Val Nolav Nov 23 '17 at 19:15
  • everything is in my machine. i updated my OS on Mac and now I do not know where is my private key. – Val Nolav Nov 23 '17 at 19:17
  • sorry, but at this point the question is all over the map - I suggest you delete everything and start over - quit Xcode, delete all profiles, remove all certificates from keychain, go to portal and delete all certificates and profiles, and begin from scratch – matt Nov 23 '17 at 19:23

2 Answers2

2

I think you should start over.

  1. Quit Xcode.

  2. Delete DerivedData folder.

  3. Delete ~/Library/MobileDevice/Provisioning Profiles folder.

  4. In Keychain Access, delete everything related to Apple development.

  5. Go to portal in browser and delete all certificates and profiles.

Now start afresh.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Also keep in mind, just in case this is not clear, that an archive is made with a development profile but the ad hoc export is done with the ad hoc distribution profile. – matt Nov 23 '17 at 19:29
  • How come I can delete all my certificates on portal? There are many different apps live on App Store! – Val Nolav Nov 23 '17 at 19:31
  • I don't see how that's relevant. I've got apps on the app store and this is something I do from time to time (at least once a year, in fact). Revoking the certificate won't magically drill thru to the app store and blow up the existing apps. – matt Nov 23 '17 at 19:34
  • I did not delete my keychains but deleted the provisioning profile on Apple Developer Portal and cleared derive data and provisioning profiles folder. Thanks – Val Nolav Nov 23 '17 at 21:55
  • Cool! So you didn't actually have to revoke / delete any certificates? – matt Nov 23 '17 at 21:59
  • I revoke provisioning profile on Apple Dev Portal but not any keychain in my device. – Val Nolav Nov 23 '17 at 22:48
  • We're having a terminology problem. Certificates are not provisioning profiles. Both are at the portal. So I don't know what you deleted there. – matt Nov 24 '17 at 00:19
  • 1
    This answer is the only method that works for me to resolve this problem and it seems that I have to follow all 5 steps religiously to get it work. Just for reference, this link https://stackoverflow.com/a/39495772/1724059 shows how to delete the DerivedData in the above point 2. – CodeBrew Jul 30 '18 at 18:52
  • 1
    @CodePlumber Thanks. I actually perform these steps quite routinely, surprisingly often. It's not difficult at all. – matt Jul 30 '18 at 19:33
0

I was able to locate the Xcode-AlternateDSID and Xcode-Token keys in Mac OS's Keychain Access utility. The utility allowed me to change the passwords to the keys after I entered the administrative password for my computer. Then I could use the new passwords when Xcode asked for them. This restored the missing private key for my iOS Distribution Certificate.

Gene
  • 1