[iphone] 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?

This question is related to iphone ios xcode code-signing

The answer is


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


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


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


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.


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.


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 !


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.


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


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


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.


  • 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!


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/


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.


Examples related to iphone

Detect if the device is iPhone X Xcode 8 shows error that provisioning profile doesn't include signing certificate Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone Certificate has either expired or has been revoked Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? cordova run with ios error .. Error code 65 for command: xcodebuild with args: "Could not find Developer Disk Image" Reason: no suitable image found iPad Multitasking support requires these orientations How to insert new cell into UITableView in Swift

Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to code-signing

Xcode error: Code signing is required for product type 'Application' in SDK 'iOS 10.0' Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error Xcode 7 error: "Missing iOS Distribution signing identity for ..." The executable gets signed with invalid entitlements in Xcode iOS 7.0 No code signing identities found “Unable to find manifest signing certificate in the certificate store” - even when add new key Code signing is required for product type 'Application' in SDK 'iOS5.1' Why is my locally-created script not allowed to run under the RemoteSigned execution policy? The entitlements specified...profile. (0xE8008016). Error iOS 4.2 Xcode 'CodeSign error: code signing is required'