How to reset app signing process in Xcode - ios

I can’t sign my app in Xcode, therefore I’m looking for a way to completely reset everything I have to in order to be able to sign it. I did
Revoke all certificates in the certificates, identifiers & profiles menu in http://developer.apple.com
Delete all provisioning profiles in http://developer.apple.com
Delete all iPhone development and iPhone distribution certificates in my keychain
Delete the provisioning profiles in Xcode
and then
Create new certificates in developer.apple.com
Create new provisioning profiles in http://developer.apple.com
Download certificates and add them to my keychain
Use new provisioning profile in Xcode
Unfortunately I’m still encountering this error (item can't be found in keychain), which leads me to the assumption that I did not successfully reset all the app signing process in Xcode. Can anyone give me a hint?

I had this issue last week with my own app. I did multiple things to fix this at once, so I'll tell you what I did, and hopefully one of them works.
Try:
Removing and deleting all certificates, devices, and provisioning profiles from your developer account and recreate them.
Download the developer and distribution certificates, and right click on them to add them to your keychain.
Download your provisioning profiles to your mac and right click on them to add them to whatever they get added to.
MAKE SURE YOU HAVE AN ACTUAL DEVICE ADDED TO YOUR DEVELOPER PROFILE ON DEVELOPER.APPLE.COM
In xcode, go to accounts and make sure you are signed in with your developer account and you have the correct profiles downloaded. In your app's build settings/signing settings, make sure you don't have your "Personal Team" profile ANYWHERE that it asks for some sort of signing/developer/provisioning Profile.
If this answer helped you, please mark it as the answer.

Related

No matching provisioning profiles found (None of the valid provisioning profiles allowed the specified entitlements)

I am getting an error when archiving:
Code Sign error: No matching provisioning profiles found: None of the valid provisioning profiles allowed the specified entitlements: com.apple.developer.in-app-payments.
I added apple pay capability since the last time I archived successfully, so it's probably to do with that. How do I add the entitlements to the provisioning profile? The whole certificates/provisioning profiles/app id concept is so confusing, wondering if there are any good reads (for dummies) on exactly what/why/how these work.
You need to go to developer.apple.com and log in as your developer account. Go to the Certificates, Identifiers, and Profiles section, and find the app ID for your app. Click on it to expend the capabilities for the app ID. Make sure In App Purchases is enabled for both development and distribution (more info here).
Once you've made sure it is there, you'll want to re-generate the provisioning profile for the app ID, and then re-download the profile to your Mac. I tend to remove all my old provisioning profiles when I do this, since having multiple profiles for the same application ID can sometimes confuse Xcode. Provisioning profiles on your Mac are stored in /Library/MobileDevice/Provisioning Profiles/
After doing this, it isn't necessary, but I usually recommend devs to quit and relaunch Xcode.
As for resources, I think Apple's session, What's New in Code Signing, from WWDC 2016 was a great one for understanding the components that are required for code signing to work.
The whole certificates/provisioning profiles/app id concept is so confusing
Not only for you :). You don't have to add entitlements to your provisioning profiles. Try to go to apple developer website add your mac (if you didn't do it already) and generate new provisioning profile. After that download it and click 2 times (xCode should automatically add it to the project). If it doesnt solve the problem try to look into project structure code and change developer/project numbers manually to proper one.

Xcode 6 App Store submission fails with "Your account already has a valid iOS distribution certificate"

I'm using the latest XCode (6.1) and I need to submit the app as soon as possible, but I can't seem to get around the "Your account already has a valid iOS distribution certificate" error.
I have the client's provisioning profile and I have his distribution certificate (which is valid) and his private key (I've checked using Keychain, it's definitely there). The bundle ID is also correct. I've deleted my provisioning profiles and certificates and reinstalled the client's many times now.
What could be causing this issue? I've seen a lot of topics here on SO with this problem, so I apologise beforehand for creating yet another clone, but I really don't know how to fix this.
edit: I'm running a brand new install of Yosemite by the way
Got it solved by editing the iOS Distribution Provision Profile in the Developer Member Center.
For some reason there were 2 certificates to choose from for the Distribution Provisioning Profile. I switched over to the other certificate and I could Validate and Submit my Archive build for beta testing.
So, you may have more than one certificate for signing your Provision profiles. Make sure you have the right one (by trying all of them) and hopefully that should work.
I tried many things like Exporting Developer profile from Xcode Accounts and importing it in the organizer, installing the provision profiles from the member center, adding them to my keychain. But none of those worked. It started working only after editing the appropriate Provisioning Profile manually.
You could also trying removing all your available Provisioning Profiles and let Xcode create new ones for you. This will work too.
I also had this issue, which turned out to be caused by an attempt to export for ad hoc deployment using a development provisioning profile instead of a distribution profile. It seems this is no longer supported in Xcode 6.1. Once I created an ad hoc profile and installed that the problem went away. A more useful error message would have saved me hours of work and would be greatly appreciated, Apple.
This thread was helpful:
xcode 6 beta 2 issue with exporting ipa "Your account already has a valid iOS distribution certificate"
Besides all the other answers, there's one more possibility after 2/15/2016: the old World Wide certificate expired and I guess everyone has already downloaded the new cert (or check this out). However, you'll be seeing this error if you haven't remove the expired one. You may need to choose View -> Show Expired Certificates to unhide expired certs. If the error is still there, try regenerate provisioning profile as advised by the others.
I was moving to new Mac when I faced this issue.
On your older Mac:
Go Preferences > Accounts > Select Account > Details.
In the dropdown right click on iOS Distribution (or whatever is the name of your distribution certificate).
Export...
Set a password for the .p12 file.
Move and install this .p12 in the new mac.
Try Again.
Another possible cause for the problem (at least in my case) was that in my Keychain Access, I had two certificates for the team I was working with. One was expired, and the other one was the one I wanted to use. Deleting the expired certificate in Keychain Access solved the issue.
I ran into this problem, and I wanted to avoid screwing up my push notifications.
The easy fix for me was to just go to developer.apple.com > project > certifications, ids, and profiles > profiles > create a new profile (for development or distribution)
Download the created profile, drag and drop the profile over the Xcode icon, and then in your project target, set the new profile as the provisioning profile.
This fixed my problem--it may provide further help in the future.
The error message could mean that you need to get the Distribution certificate and private key from the developer who created them.
This can happen if some other team member has pressed the enticing "Reset" button (which means revoke certificate and create a new one).
Here is a picture what the revoked certificate looks like:
You can export the valid certificate from the developer who created
it and import it to other team members keychains.
Go to "Keychain Access" app.
Click on the "Login" in the top left box
Click on the "Certificates" on the bottom left box
Check which team member has the valid certificate:
when clicking on the "iPhone Distribution" certificate
everyone else sees "This certificate is revoked" in red at the top.
(Maybe backup the deleted certificate to avoid doing anything irreversible)
delete the revoked certificates
Export the one valid certificate and distribute to team
Import the certificate file for everyone else
Today I was solve problem by delete from keychain old certificate Apple Worldwide Developer Relations Certification Authority and install new one (exp. in 2023)
I'll add to here because while the accepted answer got me on the right track it wasn't the solution. There was a second (automatically created by Xcode) distro cert which I revoked. After doing that a new error came up. ("An App ID with Identifier '' is not available"... it also wasn't helpful) Eventually this lead me to the fact that my App Id in the member portal didn't have entitlements matching the build.
I solved this issue by editing the provisioning profile in the member center which is used in my app and re-install the provisioning profile.
I recently changed computer.
The reason for me was that I had several developer certificates in the Apple Developer member portal.
The solution was :
Go to Apple Developer Portal
Go Under Certificates -> Production
Click on "Revoke" for the oldest certificates and keep the most recent one
Revoking certificates won´t affect your Apple Store apps :).
I had this happen to me when I accidentally reset the certificate on another mac. Here's my scenario.
Mac1 - Had working certificate.
Mac2 - I accidentally reset the iOS distribution certificate
Mac1 stopped working and I get the message "Your account already has a valid distribution certificate"
The fix was
On Mac2, Keychain access -> certificates -> iOS Distribution certificate (for you/your company) -> export to p12 file (it will ask you to set a password)
Copy the exported file to Mac1
On Mac1, Keychain access -> certificates -> iOS Distribution certificate (for you/your company) -> delete (this is the old one that does not work)
On Mac1, double click the p12 file (then enter your password).
You should see a new iOS distribution certificate (for you/your company) in the certificate section of Keychain access.
This fixed the issue for me on Mac1.
Got it solved by deleting the provisioning profile which is managed by Xcode
(XC iOS Ad Hoc: *) from the member center

Valid signing identity not found, I have tried other solutions, but doesn't seem to work

I have looked at lodes of other posts about this and tried all of them, but I still keep getting this error...
I have opened key chain and there is a developer ID which is "valid" and a private key.
I have re-created several provisioning profile for the apps (selecting the app and device).
I am on a team based account, so I cant delete all the other provisioning profiles as other people may be using them, which is what a few solutions have said, but I have tried deleting all the provisioning profiles for the app and re-making them, but it still doesn't seem to work.
I am using xcode 4.6.3 and trying to install the app on iPad 6.1
Here are screenshots:
May be your certificate is revoked and signed with a different key which you don't have, ask for the private key of newly signed certificate may be some has it.
Hope it works.
Edit
Your Developer profile needs to be recreated, and you can revoke your own developer certificate, it will not harm anyone else if you are in a team.
Edit 2
To create a new developer certificate do the following
Delete the old developer certificate.
Login to your developer portal developer.apple.com/iphone
Select Certificates, Identifiers and Profiles from iOS Developer
Program menu on right.
Choose Certificates, then choose Development.
You will see your Developer certificate there, select that, then you
will see Revoke option, press that and Revoke.
After revoking there you will see steps to create the Certificate
follow that.
After creation you will need to update the Profile too with the new
certificate.

Provisioning Profile ERROR while running in iPad

I am using Xcode 4.6.3.
I am getting this error messages while running the application in iPad,But first it was running correctly. Now we have renewed our license so i have changed certificate and
profile.still the same error appears
Please help me...
you need to follow this step:-
You Provisioning profile Generate with developer certificate from iTunes dev center.
remove old install App from device may be you Ipad contain old profile reference.
After connect your device to Xcode-Organizer->device->yuorIpad->Provisioning--check there old Provisioning profile is ther or not. if there then remove it.
In your target And Project check-> your Identifier is currect or not for example com.yourprofile.yourId
In Build setting you->code signing ->selection profile is correct identifier or not
Now just clean your Project. Build and run.
EDIT
Do not forget to Adding New testing Device ID into your new Generate Provisioning profile. in iTunes Dev there is Column to adding Device and also asking Device while you Generate Provisioning profile. May be you forget this step.
be sure that you are generating provisioning profile after adding device, or when you're just renewing profile.
And your provisioning profile must be linked with certificate, that you have in keychain.
(certificate+key)
All devices must be readded on demand, after renewing dev program (!)
In general, It's pretty sraightforward (just try it from the clean sheet, delete all the old stuff)
1) cert signing request
2) appid (if new app, if old just skip, optional - apns stuff)
3) certificates dev/distr (import them)
4) devices
5) provisioning profiles (import them)
in xcode choose in all positions needed profile, sometimes choosing parent option do not change profile for all fields of "Signing Identity" in xcode.
Deleting of old provisioning profiles is optional, it's not a problem when you have many of them
it's only problem when signing identities are more then one, ie: old expired and new one.
(In xcode 5 it will be easier to choose identity)
EDIT: it really seems like in build settings in code signing identity select options (some option) an old profile is chosen, and xcode gives this error.

Certificates won't show in code signing identity in build settings

I'm encountering the errors:
No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.
and:
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'
XCode isn't giving me any option other than "Automatic iOS Developer and Distribution" options in the 'Code Signing' area of the 'Build Settings'.
I've tried changing the bundle id to match the certificates exactly, as well as a more generic com.domain.appname ID, I've deleted and recreated the provisioning profiles - I'm really lost, it feels like it should be something really simply but I can't get my certificates to show in the settings.
I was shocked when having the same problem and reading some answers here, too complicated. But I solved this much much simpler.
Open Keychain Access. Delete iPhone Developer and iPhone Distribution certificates, although they are still valid.
Open Apple Developer Centre. Download iOS Development and iOS Distribution certificates again. Yes, I download them again as they are written as XXXX-1.cer
Drag them to Keychain Access to reimport them.
Rerun XCode. Problem solved.
The first thing I would check is that your Cert in Keychain Access is present and is married up to your private key. If it's listed but your private key isn't paired with it you've likely changed your Mac's password recently and instead of pressing "Update Keychain" you may have clicked on "New Keychain". This will require performing the CSR process again and adding that new cert from the portal to the existing prov profiles. (A screenshot here may help).
Next I would make sure that XCode's Organizer is showing your provisioning profiles as valid with a green checkmark. If they aren't valid XCode will tell you why. This could be anything from the missing private key to your cert wasn't added to the profile in the dev portal. (Another screenshot here may help).
If all of that looks good restart XCode. I've had problems with XCode not properly importing prov profiles until I give it a swift kick in the pants via restart.
What worked for me was to create a new iOS Provisioning Profile in apple portal then download and add it to the Organizer in XCode , my scenario was that I was importing the project from another user account and when Titanium was compiling the project had the iOS Provisioning Profile associated from the other user account therefore was crashing, so when I was ready to compile in the Run on iOS Device dialog I changed the Provisioning profile to the new one.
As it has been stated before, you need to see the green button (valid profile) in the Provisioning Profiles for your device .
Good luck! it took me two days to fix this!
Ren#ud

Resources