44

I've been working on an iPhone project with iOS 4.0. I just downloaded Xcode 3.2.4 with iOS SDK 4.1 so that I can work with the updated iOS. Upon opening the project in the updated Xcode, I found that the target read 'Base SDK Missing'. I fixed that by following the instructions here.

Now when I try building targeting any version of iOS, I receive this error (with the corresponding version referenced in the error text):

CodeSign Error: code signing is required for product type 'Application' in SDK 'Device - iOS 4.1'

I have the Team Provisioning Profile created by Xcode installed, that Provisioning Profile has my certificate, and the Code Signing Entity selected is 'iPhone Developer: Aaron Milam'.

Any ideas as to what I could be missing here?

2
  • Complementary question: Xcode fails with "Code Signing" Error Commented Dec 20, 2012 at 15:43
  • check list before you proceed: open xcode -> preferences -> check if item exists in apple ID, select the agent and view details -> check signing identities exists, provisioning profiles exists. if signing identities not exist need to add the apple dev certificates. then it should be fine.
    – Desmond
    Commented May 20, 2015 at 3:25

15 Answers 15

40

It happens when Xcode doesn't recognize your certificate.

It's just a pain in the ass to solve it, there are a lot of possibilities to help you.

But the first thing you should try is removing in the "Window" tab => Organizer, the provisioning that is in your device. Then re-add them (download them again on the apple website). And try to compile again.

By the way, did you check in the Project Info Window the "code signing identity" ?

Good Luck.

5
  • 2
    If it doesn't work, then : 1°) Reboot your computer. 2°) Remove all your computer certificates (related to iPhone, not all all ^^). 3°) Re-Download them. Without having your computer near me it's a bit difficult to solve this :/ Good Luck !
    – Vinzius
    Commented Sep 27, 2010 at 13:48
  • 2
    So I followed your instructions. I found that in Xcode, <Multiple Entities> was selected for code signing. I reselected my own, and that ended up working! Thanks for your help!
    – Aaron
    Commented Sep 27, 2010 at 14:30
  • 8
    For me I had the correct settings in the project, but forgot to check the target. Setting the code signing identity setting in the target build properties did the trick Commented Sep 30, 2010 at 1:47
  • Also, try to go to Build>Clean, then try again.
    – Baub
    Commented Apr 18, 2012 at 22:08
  • 5
    "It's just a pain in the ass to solve it" on the top rated SO answer for a question with +60k views is a really powerful statement! As far as feedback goes, this is a perfect storm: negative, provided by a credible source, and agreed upon by the community. @Vinzius, thank you for posting this. I hope Apple addresses your feedback...4 years and counting :) Commented Oct 15, 2014 at 18:37
20

Be sure you code sign on the line "any iOS SDK" and not "Debug/Distribution/Release"

Here is exactly what I did :

Code signing identity -> don't code sign
* Debug -> don't code sign
** any iOS SDK -> [my developer profile]
* Distribution -> don't code sign
** any iOS SDK -> [my AppStore profile]
* Release -> don't code sign
** any iOS SDK -> [my AdHoc profile]

When I put my profiles one level above (at Debug/Ditribution/Release), it doesn't work for some reason (bug ?).

Hope it helps some of us !

3
  • 1
    Does anyone know why you set "Don't code sign" for debug and release?
    – mskw
    Commented Mar 20, 2013 at 22:31
  • 1
    May you please share a screenshot on where to find these settings?
    – Noitidart
    Commented Apr 11, 2017 at 2:16
  • @Noitidart Click on the project -> Build Settings tab Commented Jun 20, 2018 at 6:36
9
  • I love Stack Overflow:

  • I realized that some time being too specific is not enough that is because we may have different Xcode version, I have 2 xcode version on the same Mac Pro myself. So here I would like to provide a general instruction that i hope it will work for all Xcode version:

  • My 2 versions are xcode 3.2.6 and 4.0. You need to find (even google for the settings) your xcode BUILD SETTINGS and its CODE SIGNING under CODE SIGNING you have CODE SIGN IDENTITY this provide you a list of IDENTIFIERS (if you do not have IDENTIFIERS go here to get one and registration is required https://developer.apple.com/ios/manage/overview/index.action - follow this instruction of Apple "Get your application on an iOS with the Development Provisioning Assistant") If you have a list of identifiers just select a valid one and run your Xcode again. It will work!

  • 3.2.6 specific: On your scode window - click on Project -> Project settings -> Build (tab) -> there is a scroll down because the list is long MAKING SURE you scroll down to find your CODE SIGNING section

  • 4.0 specific: On your xcode window - click on your project file left most colum -> then next colum click on your target app -> find CODE SIGNING and assign an IDENTIFIER. It should work for you.

Done!

5

Most common cause, considering that all certificates are installed properly is not specifying the Code Signing Identity in the Active Target settings along with the Project settings. Change these from to iPhone Developer (Xcode will select the right profile depending on App ID match).

  • In Xcode , change from Simulator to Device (in the dropdown at the top of the Xcode window), so that your target for application deployment will be the Device.

  • The default ID which is a wild card ID is like a catch all iD, when associated in Code Signing (if you are using sample files to build, they will most obviously not have com.coolapps.appfile imports, in which case without the 'Team Provisioning profile', your build would fail. So you would want to set this in your

  • Xcode->Project ->Edit Project Settings->Build (tab)->Code Signing Identity (header) ->Any iOS (change from Any iOS Simulator)->(select 'iPhone Developer' as value and it will default to the wildcard development provisioning profile (Team Provisioning Profile: * )

and also (VERY IMPORTANT)

  • Xcode->Project ->Edit Active Target ->Build (tab)->Code Signing Identity (header) ->Any iOS (change from Any iOS Simulator)->(select 'iPhone Developer' as value and it will default to the wildcard development provisioning profile (Team Provisioning Profile: * )

Complete steps for a beginner at: http://codevelle.wordpress.com/2010/12/21/moving-from-ios-simulator-to-the-ios-device-smoothly-without-code-sign-error/

3

Make sure that you have created provisioning profiles correctly.. if you did.. you must be having ... public key, private key and Certificate in Keychain Access. CHECK if you have all these..

XCode 3.2.4 Comes with the Auto device provisioning ... so you just have to sign in to your developers account it will download all valid profiles..

If you have all you need in keychain and downloaded profiles... When you are selecting iPhone Developer: Aaron Milam'. in build settings.. make sure you have selected Configuration ( on left top inside Target->Build ) you want to make build for. or you can do All configuration to make changes in all available configurations i.e. Debug, Release etc.

3

Summarised form an answer to Xcode fails with "Code Signing" Error

project.pbxproj files can be merged in such a way that two CODE_SIGN_IDENTITY lines can be inserted. Deleting one of these normally fixes the issue.

I have created simple script to help diagnose this issue it can be found here: https://gist.github.com/4339226

A full answer can be found here.

3

After trying all of the above answers, and everything else I could think of from within Xcode 4.6, I fixed this with these steps:

  1. Close Xcode
  2. Right-click on .xcodeproj file -> show package contents
  3. Edit project.xcodeproj in a text editor
  4. Search for "CODE_SIGN_IDENTITY" - there will be pairs of lines like this:
 CODE_SIGN_IDENTITY = "iPhone Developer: Joe Smith (555NN555)";
 "CODE_SIGN_IDENTY[sdk=iphoneos*]" = "iPhone Developer: Joe Smith (555NN555)";

I found 2 targets with value like that, and 2 targets with

 CODE_SIGN_IDENTITY = "";
 "CODE_SIGN_IDENTY[sdk=iphoneos*]" = "";

I copied the former pair of lines over the latter pair of lines for all cases where the latter pair was emtpy.

I then restarted Xcode, and it works fine now.

1
  • Wow this truly solved that stupid error for my project (Testapplication from SendBird). This took me a whole hour to find out. Thx. I made all of them "" and Xcode stopped complaining. Commented Feb 23, 2016 at 13:41
3

As already mentioned here if you don't want to code sign you application you can set CODE_SIGNING_REQUIRED to NO. Here is method to do it without any project/files modification:

Create file NoCodeSign.xcconfig:

CODE_SIGNING_REQUIRED = NO

Set XCODE_XCCONFIG_FILE environment variable to path to this file:

export XCODE_CXCONFIG_FILE=/path/to/NoCodeSign.xcconfig

Now you can build your application without code signing.

2
  • Contents of NoCodeSign.xcconfig should be CODE_SIGNING_REQUIRED = NO obviously Commented Nov 1, 2016 at 14:59
  • This was helpful, but I ended up needing CODE_SIGNING_ALLOWED = NO in Xcode 10, instead of CODE_SIGNING_REQUIRED = NO Commented Sep 26, 2019 at 13:51
3

In my case, locking and unlocking login-keychain from Keychain Access did the trick enter image description here

0
2
  1. Populate "Code Signing" in both "Project" and "Targets" section
  2. Select valid entries in "Code Signing Identity" in both "Debug" and "Release"
  3. Under "Debug" select you Developer certificate
  4. Under "Release" select your Distributor certificate

Following these 4 steps always solves my issues.

1

Another possibility - When you Build for Archive make sure your Archive choice in your scheme is set for Distribution, not Release.

Go to Product -> Edit Scheme This brings up a new dialog.

Select Archive on the left. Make sure the build configuration is Distribution.

1

In file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist

change the CODE_SIGNING_REQUIRED YES

to

CODE_SIGNING_REQUIRED NO

Restart Xcode

0

Have you updated the firmware version of the iPhone you are testing on?

1
  • Yes. In fact, it just arrived in the mail with the latest version. I did check for updates to be sure.
    – Aaron
    Commented Sep 27, 2010 at 15:18
0

I use Xcode 4.3.2, and my problem was that in there where a folder inside another folder with the same name, e.g myFolder/myFolder/.

The solution was to change the second folder's name e.g myFolder/_myFolder and the problem was solved.

I hope this can help some one.

2
  • It's kinda dumb how Xcode doesn't allow you to have multiple folders of the same name, isn't it?
    – Aaron
    Commented Jun 19, 2012 at 14:13
  • @Aaron yes it is, I hope they fix this "bug".
    – marcos1490
    Commented Jun 19, 2012 at 21:11
0

Maybe your mac's date and time are incorrect. Just correct them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.