Xcode: iPhone app codesign error
Asked Answered
S

10

37

When building a new iPhone app in Xcode, I'm getting this error:

codesign error: code signing identity 'iphone developer' does not match any code-signing certificate in your keychain. once added to the keychain, touch a file or clean the project to continue.

What's the fix?

Supposititious answered 30/12, 2008 at 17:19 Comment(1)
Complementary question: Xcode fails with "Code Signing" ErrorEncroachment
S
63

The fix is pretty simple. In the Build Results window (which you probably got to by clicking the error icon in the lower right corner of your project window), change the pulldown menu from ‘Device - iPhone xxx’ to ‘Simulator - iPhone xxx’.

xcode-screenshot
(source: kickasslabs.com)

Supposititious answered 30/12, 2008 at 17:19 Comment(3)
Answering my own question because I think this will help others.Supposititious
Thanks Gabe, I got the same error after upgrading to SDK 3.0 and spent waaaay too much time trying to fix itClarineclarinet
Thanks a lot... That saved my frustration. Just learning the whole thing I have spent hours to try to compile my code...Maier
C
13

You need to be part of the $99 developer program to test on the actual phone. Apple should have info about how to sign your code once you're accepted into the program.

Cyndicyndia answered 1/1, 2009 at 12:23 Comment(1)
That's $99 per year, not just $99 :)Coumarone
C
9

I got this error when I accidentally modified the code signing identity build setting at the target rather than the project level. Make sure that you have the correct information entered at the project level (get info on the project, rather than the target.) If you changed the target build settings, try deleting the values from there. The target will then inherit the project's setting.

I would also do a "clean all", then exit xcode, delete everything from the build folder and try to do another build. (This is an Xcode voodoo trick that seems to solve many code signing issues.)

Colas answered 30/12, 2008 at 23:27 Comment(2)
I was getting this error too, and was mistakenly selecting the Target instead of the Project. Selecting the Project and updating the Signing Cert there fixed the problem.Excrescent
I did the reverse: Kept changing the Project settings and Clean All with no results. Then I edited the Active Target, Set the proper Code Signing Identity of the Distribution Profile (duped from Release Profile). That did the trick. Thanks @lajos!Intrados
W
7

I just solved my code signing problem. What a nightmare! Over 8 hours of frustration over two days. I tried new apps, new app names, new certificates, deleting provisioning profiles etc. Basically I had two "iPhone Distribution" certificates in my keychain causing all code signing to fail. But one was hidden! The visible cert was in my Login keychain. The invisible cert was in my System keychain. Be warned, add your certificate to either keychain but not both! I deleted the certificate from the System keychain and it became a ghost certificate. It no longer appears in the System keychain "Keychain Access" tool but it did exist in the actual System keychain file, so effectively it had not been removed. I grepped the keychain file for the word Distribution and there it was! My solution was to remove that line containing iPhone Distribution from the keychain file which fixed the code signing. The result is I have a broken System keychain. But I can sign apps again \m/

Wonderful answered 14/10, 2010 at 11:2 Comment(0)
U
3

this may sound funny, but I searched everywhere for a solution. Eventually I found out that in Xcode in the top left, the dropdown where you select Device and verison, I had "debug" selected in the dropdown instead of release. Once I selected release the problem was fixed.

Unlawful answered 10/11, 2010 at 4:40 Comment(0)
V
2

I had the same problem. Found the fix here:

iphone sdk tools utilities

In Keychain Access.app my Developer Certificate would show up as "This certificate was signed by an unknown authority". The reason was that I didn't have the ADC intermediate certificate (which you can download from "Provisioning Program" in "Certificates" tab. Once I installed this the developer certificate showed up correctly in keychain and my code could be deployed on the bloody phone.

Vesica answered 22/5, 2010 at 13:34 Comment(0)
I
2

This situation is happening when you receive a Xcode project from other person.

Here is what I did to solve the problem.

  1. Register your key in a key chain access. You can download your key in iOS provisioning portal. (Application -> Utility -> Keychain Access)
  2. Install Provisioning file for the app.
  3. Change iPhone developer in a project configuration. (Target Info -> Build tap -> Code Signing -> Code Signing Identity and Any iOS)
Inhume answered 14/10, 2011 at 6:28 Comment(2)
What do you mean "Build tap"?Supply
I mean a tap named Build in Target Info window.Inhume
E
1

No Voodoo necessary. Sometimes some app changes default keychain and Xcode stops finding iPhone Developer Keys. The solution is simple (it worked for me):

  1. List item Start Keychain Access app
  2. Ctrl+click on keychain where you stored your development keys and select Make Keychain Default
  3. Enjoy developing great iPhone apps.
Echinoid answered 22/5, 2009 at 20:36 Comment(0)
F
1

When none of the above helped me, I accidentally removed my card reader with my electronic signature certificate on it and now my app builds without errors. If you have such certificate, try unplugging it for a moment.

Fa answered 21/8, 2012 at 10:24 Comment(0)
T
1

I just solved my problem doing this:

  • click in your main project folder in Project Navigator
  • at the right side window, choose your Target
  • under "Code Signing", change the Code Signing Identity from whatever it was to yours
  • set the active scheme (at top left, besides the "Run" button) to your iPhone/iPad

Hope this help someone out there !

Towle answered 17/11, 2012 at 10:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.