iOS - Cannot Install Certificate - ios

I've been around Stack Overflow a lot trying to solve this issue, and it's making very little sense.
I'm trying to publish an app, but I'm getting the error:
This is utterly confusing, because we have three different certificates for iOS Distribution and I've downloaded all three of them and attempted to add them to Keychain. The Preference->Accounts=>View Details dialog does not show the certificates. It only displays (even after refreshing) an iOS Development and a Mac Development certificate. When I attempt to add an iOS Distribution certificate I get a similar error, despite the fact we have THREE valid iOS Distribution certificates.
I've started from scratch too. I deleted all provisioning profiles related to the app in the Member Center, recreated the app Identifier to make sure it mirrors the Bundle Identifier, and generated a new provisioning profile with the valid certificate and app ID, downloaded and installed it, and I am STILL getting the same error.
I've gone into Build Settings and switched between automatic and assigning specific provisioning profiles.
The biggest issue is that the certificates don't appear in keychain. I double click on them and keychain opens, but nothing happens. I drag them into keychain, and still nothing happens.

Related

Xcode validation failure

Validation of an archive for uploading to the store is failing in the Xcode Organizer with this message: "Failed to locate or generate matching signing assets: Xcode attempted to locate or generate matching signing assets and failed to do so because of the following issues. Permissions failure - Your account does not have permission to create profiles."
This problem has been reported by several other people on StackOverflow and Apple Development Forums, with no resolution. Here I'll explain some things I've tried with the hopes that maybe someone can suggest a solution. This is a really important problem because it's preventing release of an app.
Does anyone know how to fix this? Does anyone know what the "permission to create profiles" is referring to? From my understanding, the Organizer should just be signing the app with an existing Provisioning Profile, not creating any new ones.
Background information: I have admin privileges in a company team and am able to build the project fine. My development certificate works ok for installing to a phone. There are no expired certificates in my Keychain and the certificates in the key chain look ok. I have rebuilt the Distribution certificate and downloaded it to my Mac successfully.
The problem occurs whether I select manual or automatic provisioning in Project Settings (though this shouldn’t affect archive validation anyway). I have the original distribution Certificate on my machine from importing a .p12 file from the original developers. I’ve tried rebooting my Mac, restarting Xcode.
Issues I can think of looking at next: (1) I am using a wildcard in the app bundle name in the Distribution Provisioning Profile. Is there any problem with this? The wildcard seems to match the app bundle ID in the build. The app has previously been released without an explicit app bundle name in the provisioning profile. (2) The distribution provisioning profile has no services enabled. The app Project Settings include one service: Remote Services under Background Modes. Is there a problem because of this mismatch? (3) Should I try using Application Loader instead of the Xcode Organizer?
The problem, it turns out, was a bad Distribution Certificate. The team I was working for turned out to have two Apple Developer accounts with the same name, but one was an Enterprise account and the other was not. I had been given the Distribution Cert for the Enterprise account. Once I deleted all my relevant certificates from my keychain and XCode Preferences/Accounts and read in the .p12 file for the correct Distribution Cert, everything worked.

Appcelerator - CodeSign issue since adding new UDIDs to provisioning profile

I recently added some new UDIDs to my AdHoc Distribution Provisioning profile. I then downloaded the updated certificate and since then I have been able to publish my iPhone app as I keep getting a 'Codesign' issue.
I've tried everything seen in many other posts on this forum including deleting and recreating my developer and production certificates and deleting and recreating my provisioning certificates (Both Developer and Ad Hoc Distribution).
I now can't even 'run' the app to my iPhone attached to the computer (which wasn't one of the new UDIDs - deployment to this phone has always worked).
I'm at a loss where to turn as
Apple tells me my Provisioning Profiles are 'Active'
Xcode shows the correct Provisioning profiles
My Key Chain tells me I have two valid certificates (one iPhone developer, one iPhone Distribution).
Appcelerator gives me all the ticks when I am choosing which profiles to use in the build
I have been 'cleaning' my app and restarting Appcelerator like crazy but with no luck
I really need to get this app over to the client, but have no idea what is 'wrong' as everything matches up. Is it possible Xcode has cached old certificates? Has something got corrupted?
I have been through this issue in past month, the problem was exactly same as yours, everything was showing correctly.
But from your Keychain screenshot, I think there is no private key (this was my case also) attached with your certificates which is the issue of CodeSign.
If you even install the .cert file, it will still show it as a valid certificate, but you might not be able to sign your code due to missing private key.
So, make sure you get the private key added along with the certificate in your keychain. If it does not works for you then you should create new certificates from same machine you will distribute the app as it will save a lot your headaches :)
As is often the case - this was a very simple issue wrapped up as a complex one.
When creating a build (both under 'Run' and 'Package'), you can select which KeyChain to use. Somehow this dropdown had changed from 'System Defaults' to another one... changing this Select KeyChain drop down back to System Defaults was all I had to do!
Thanks to #prashant-saini for getting me thinking about keys and keychains!

Xcode 6.1 iOS Distribution is always revoked or missing

I'm trying to submit an app but I'm stuck. I can't get a the iOS Distribution signing identity to show up as valid under my account in Xcode 6.
It always shows up as revoked, never valid. I've made sure to connect it to my provisioning account on the dev site.
I also went to the developer site, revoked it there, recreated it, then went back to xcode to try to submit my app but I get this message:
When I check my account in preferences after getting this message, the iOS distribution doesn't even show up:
And when I try to add one it says:
I've tried:
Deleting the iOS Distribution cert and regenerating it on xcode (generates as revoked)
Deleting it and creating it on developer.apple.com
Linked my provisioning profile to the correct app id
Using Xcode 5 to submit my build instead
I don't know what to import or where to find a developer profile from. I've checked the dev documentation and it says the Your account already has a valid iOS Distribution certificate error happens when switching mac computers, but this is all on the same machine. I am using a VMWare to run this on an virtual image of iOS Mavericks, could that be culprit?
Make sure the time settings on your Mac are correct.
When you use a virtual machine and pause it, it pauses the time on the Mac as well. Your time settings are probably pushed back because of it, making your certificates invalid valid until a time later in the future.
For more info, see: Distribution certificate error:"This certificate is not yet valid."

iOS Provisioning profile: Valid signing identity not found

I am trying to test the push notification functionality on a device. I followed this article. http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
So the issue is when I download the development provisioning profile and import it into xcode then it says the valid code signing identity is not found.
This stops me from building the app as General projects settings says no matching provisioning profiles found.
No matter how many times I push fix button this wont go.
The app ID and provisioning profiles looks good on iOS Dev center.
I have tried deleting them and recreating them again and again but issue remains the same.
Also my build settings are:
There is only one option for code signing identity and that is "iPhone Developer" as no other matching code signing identity is found. I have tried deleting the app and recreating it in xcode also. I have double checked the bundle ID. And I have google a lot. Everyone says revoking the certificate and recreating fixed the issue but not in my case.
Also the keychain seems to have the correct public and private key.
I am stuck on it for last 2 days :(
Make sure to delete the old .cer file from you Keychain and download the latest one.
If the CertificateSigningRequest.certSigningRequest is created from another machine, get the corresponding .p12 file and add it to your Keychain.
Thats it. Now double click on your provisioning profile and it should be valid.
Worst solution:
If you are unable to get the .p12 file, Revoke your existing certificate and configure all again.
Fixed it by deleting all development certificates in iOS dev centre (even my iOS development certificate) and recreating new ones from beginning. I had 2 iOS development certificates and I think Xcode was confused about which to use. This happened because I have revoked my development certificate from another machine and thus creating a new one. Somehow it ended up in two developer certificates managed by xcode. Since then i have'n tested any app on device and so though that was the problem.
Install the valid p12 file (i.e) double click the valid p12 file.

Certificate identity 'iPhone Developer: ' appears more than once in the keychain. The codesign tool requires there only be one

Ok, I am completely pulling my hair out on this one.
Back in July I created a provisioning profile so I could test on my iPad.
Then at the end of August I tried submitting my first App to the iTunes Store. The process was a complete nightmare, and I struggled. A lot. In the end I found a tutorial with relatively recent information in it, and only by following it step by step could I actually get anywhere with this. Unfortunately the result of this was that I created a new provisioning profile.
Now when I try to test on my iPad I get the following error in Xcode:
Certificate identity 'iPhone Developer: MyName' appears more than once in the keychain. The codesign tool requires there only be one.
I check the keychain, and sure enough there are the two provisioning profiles for development, one from July and the one I used to submit to the iTunes Store in August.
Now what I want to do is get rid of the old one, and then connect my iPad up to the new one. I can get rid of the old one fine, but I cannot connect my iPad to the new one, it insists on using the old profile, even to the point of re-attaching it to the keychain after Ive deleted it.
Can anyone tell me:
How to connect my iPad to the new provisioning profile?
And while we are at it, can anyone shed any light on why this entire process is so convoluted and difficult? Considering that so much of Apples interface is so well designed and fluid, this process of registering certificates and applying them to different devices and Apps seems so backwards. I initially suspected this was just me, but googling for these error messages reveals that there are many who are struggling at various points along this process.
This has nothing to do with Xcode and everything to do with keychain.
Open keychain.
Find the signing certificates that are tied to your provisioning profiles.
Delete one. You probably want to keep the newer one, so look at the expiration dates and remove the one that expires first.
Restart Xcode
You may need to update your provisioning profile if it isn't tied to the new certificate, but it won't be as painful as creating a new certificate.
Here's a broad overview of how code signing in Xcode works. It a bit much but will explain what's wrong with your configuration, and how you can fix it.
There are three parts to the mechanism that ensures that you are who you say you are and that your app is allowed to run where it wants to.
You've got a pair of keys, one public and one private. Your public key matches your private key, which identifies you.
Your keys are used to generate certificates. Generally, you'll have one certificate for development and one for distribution,either on the App Store or via Ad Hoc distribution. These certificates permit you to provision your apps.
Each certificate is used to generate provisioning profiles. The profiles must be attached to either a development or a distribution certification. A distribution profile either works on the App Store, or it contains a list of device IDs which may run apps signed with that profile.
If your certificate is expired, the provisioning profiles that are created with it are going to be invalid. In this case, replace both the certificate and the profiles. Generate a certificate signing request (CSR) from Keychain Access and upload it to the developer portal.
If you have multiple certificates in your keychain, Xcode won't know which one to use. This may happen if you renew your certificate and don't remove the old one. (It may also happen if you exported your developer profile and then imported it later. Your old certificates will carry over.)
If your provisioning profile is expired or invalid, you can renew it in the developer portal without generating a new CSR. You can just attach it to an existing valid certificate.
Certificates can't be carried over from one machine to another without moving the original key pair that requested it. Exporting the certificate from Keychain will export the keys as well.
Delete the old one, and start build with new.
One more way you can try , set code signing identity with profile you want to run in both target as well as project build setting.
Hope it will help you.
Otherwise you have to delete old one.

Resources