Xcode: iPhone app codesign error

不羁岁月 提交于 2019-12-12 07:08:22

问题


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?


回答1:


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’.


(source: kickasslabs.com)




回答2:


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.




回答3:


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.)




回答4:


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/




回答5:


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.




回答6:


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)



回答7:


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.




回答8:


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.



回答9:


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.




回答10:


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 !



来源:https://stackoverflow.com/questions/400894/xcode-iphone-app-codesign-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!