Categories
iPhone app Software development

Code signing error in Xcode

Reading Time: 2 minutes

(Update 08-Dec-2020) Things I learned today (or tomorrow am 🙂

  1. One team can have at most two distribution certs
  2. In Xcode sign in as agent without the (mail.com or gmail.com after @) because it appears my apple id is just the id without all the @ + dot com stuff. That alone cost me probably one hour. Plus the one hour I tried to export cert in old MacBook, then move it over to the new MacBook. So totally 2 hours wasted… after those two steps, I was able to go back to automatically signing and validate my archive (ipa) for myNestEgg…

Managing a Distribution Certificate

No signing certificate “iOS Distribution” found

Create, export, and delete signing certificates

====

For organizations, if a distribution certificate is missing a private key or not in your keychain, you can email the creator of the signing certificate. Ask the creator to export the signing certificate on their Mac so you can install it on your Mac. (To install a certificate in your keychain, double-click the exported certificate file.)

====

What is app signing?

Creating the iOS Distribution Certificate

iOS – Creating a Distribution Certificate and .p12 File

(Original 06-Feb-2013) Had my share of code signing problem (esp. the enterprise distribution certificate) in my Xcode development. Luckily, stackoverflow rescued me as always. It seems a lot problem is due to the Xcode upgrade, project name change, provision profile/distribute certificate expiring etc. And the solution is usually delete or comment out the offending line. Like below. To go to the project file, I usually do in the command line, “cd projectName.xcodeproj”, then “vi project.pbxproj”.

http://stackoverflow.com/questions/1760518/codesign-error-provisioning-profile-cannot-be-found-after-deleting-expired-prof

http://stackoverflow.com/questions/5758154/code-sign-error-provisioning-profile-cant-be-found

I encountered another problem related to the provisioning profile expiration, the distribute certificate appears twice in the Keychain, even after I deleted it explicitly. It turns out the old distribute certificate came back after I opened the project in Xcode (presumedly it came back when the old provision profile associated with the project got loaded). So the workaround is to delete the old distribute certificate again after opening the project in Xcode.

http://stackoverflow.com/questions/5932522/codesign-error-certificate-identity-appearing-twice

Btw, saw an interesting idea from Mobile Iron regarding the enterprise distribution certificate. Normally the certificate expires in a year. In last 30 days it will prompt the user something like “the provision profile will expire in a few days…”, not good user experience. There is no way to renew it before it expires either. So the workaround suggested by MI is create 2 certificates, and create the second 6 months before the expiration and have user update the app. This way, essentially the app got extended 6 months. And so on. There is one catch in Xcode 4.3.3 I am using. It only recognizes the provision profile that was created earlier (or expires earlier). The workaround there is delete the earlier provision profile 😀

Leave a Reply

Your email address will not be published. Required fields are marked *