Monday, April 16, 2012

Xcode "CodeSign error: code signing is required"


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 udpated 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?


Source: Tips4all

8 comments:

  1. It happens when xCode doesn't recognize your certificate.

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

    But the first thing you should try is removing in "Window" tab => Organizer, the provisioning that are 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.

    ReplyDelete
  2. -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!

    ReplyDelete
  3. 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/

    ReplyDelete
  4. 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 !

    ReplyDelete
  5. 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.

    ReplyDelete
  6. Populate "Code Signing" in both "Project" and "Targets" section
    Select valid entries in "Code Signing Identity" in both "Debug" and "Release"
    Under "Debug" select you Developer certificate
    Under "Release" select your Distributor certificate


    Following these 4 steps always solves my issues.

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

    ReplyDelete
  8. 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.

    ReplyDelete