Unable to build Apple's example project core data book - iphone

I opened the core data book example directly from Xcode's documentation window. The project won't build. It says the Iphone OS 4.0 is missing. Since I used Xcode 3 with SDK of iOS 4.2, I changed the build SDK to iOS4.2 (latest), but it then says:
Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.CoreDataBooks' could not be found
If I change the code signing identity to "don't code sign", it says:
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 4.2'
I am not sure whether the $99 developer fee is required to run the example. Would that be the problem?
Thanks in advance.

Leo,
Code signing error will occur only when you try to make device build and either dont have provisioning profile or you are giving wrong information.
Following error occurs when you provide wrong identifier, If you have provisioning profile (check in organizer of XCode, under windows menu)then you should provide its app identifier starting from com. and so on.
Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.CoreDataBooks' could not be found
The second error you are getting is because you are trying to build, device build without having any profile. CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 4.2'
If you want to make that application's device build you should have right provisioning profile, else you would not be able to make it.
If you only wants to run it on simulator then you can do it easily.
On the LeftMost corner top you will fine a dropdown menu. In that you will need to select Simulator and Debug. And after that clean all targets and "Build and Run" application.
Thanks

Related

Application failed codesign verification. What do I do?

Xcode gives me this warning when I build the app for release.
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
Do I need to delete all entries from my keychain and redo getting a certificate, provisioning profile, etc?
I can build and debug on the iPhone and iPad without a problem.
If you know how I can solve this dilemma, please provide exact steps or a way for me to contact you about this.
Thanks
----UPDATE -----
Build Log
Validate build/Release-iphoneos/iApp.app
cd "/Users/iosdeveloper/Documents/Programming/iPad/iApp HD"
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv PRODUCT_TYPE com.apple.product-type.application
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation "/Users/iosdeveloper/Documents/Programming/iPad/iApp HD/build/Release-iphoneos/iApp.app"
warning: Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
Executable=/Users/iosdeveloper/Documents/Programming/iPad/iApp HD/build/Release-iphoneos/iApp.app/iApp
codesign_wrapper-0.7.10: using Apple CA for profile evaluation
/Users/iosdeveloper/Documents/Programming/iPad/iApp HD/build/Release-iphoneos/iApp.app: valid on disk
/Users/iosdeveloper/Documents/Programming/iPad/iApp HD/build/Release-iphoneos/iApp.app: satisfies its Designated Requirement
test-requirement: failed to satisfy code requirement(s)
codesign_wrapper-0.7.10: failed to execute codesign(1)
- (null)
Here's the checklist I go through when I've hit this:
Clean all targets, exit Xcode, then go drag the build folder from your project to the trash.
Do the Get Info on your project, make sure the Code Signing Entitlements and Code Signing Identity are selected correctly. Do the same for your Targets.
Login to the iOS Provisioning Portal and make sure the Distribution certificate has not expired. Also check the Distribution Provisioning Profile and make sure it is Active. Make sure the Certificate is properly in your Keychain and the Distribution profile is in Xcode Organizer (if you have multiple of the same one, delete all but the correct one and redo step #2).
Look at your Build Results on the failure and identify which profile it is actually using and make sure it is the right one.
You probably need to check what code signing profile is selected in your distribution build properties.
It looks like your target is "Development" but Xcode applied some of distribution settings to it, so the warning simply means your ad-hoc build has no valid AppStore submission certificate. Go to your target settings, choose the Release configuration and uncheck "Validate Built Product" option.
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
i am got the Same Warning Message...
I just Changed to iOs Deployment target 4.3 to 3.2.2 its works perfectly .....
Note: you may have to go to XCode's "Project" and select "Edit Active Target (appname)",
which is near the bottom of the list ... in the new pane that opens, select "Build", then
under "Code Signing Identity" select your distribution provision. Note that this seems
to be editing a different thing than "Project" / "Edit Project" (editing "target" instead
of "project"). I found I had to edit both project and target's code signing identities.
I had exactly the same problem. It was due to installing Xcode 4.0.2 and 4.2 preview 3 at the same time. Removed both (through the provided uninstall scripts):
<Xcodedir>/Library/uninstall-devtools --mode=all
Then rebooted and installed 4.0.2 and it works :/
I have found the codesign process a headache - I always shudder when I get am ready to use Ad Hoc distribution to beta test. After the usual round of errors and failed fix attempts I ignored the "application failed codesign" error and sent the build to a beta tester. It worked without issue.
Very frustrating.
In the build log provided in the -UPDATE- section of the original post the root cause of the failed signature verification is expressed with the text:
"test-requirement: code failed to satisfy specified code requirement(s)". That particular flavor of failed signature verification is almost always caused by mistakenly signing your app with an iPhone Developer profile instead of an iPhone Distribution profile.
It can be confirmed with the steps in "How do I verify the certificate that was used to sign my app?". If the certificate "Identity" is "iPhone Developer: YOUR_NAME" instead of "iPhone Distribution: ..." that is the reason for the "Application failed codesign verification" error, and you can resolve it by performing the following steps:
1a). if you have not yet created an App Store Distribution Provisioning Profile yet, that is done on the "Distribution" tab of the "Provisioning" Section of the iOS Portal site.
Note, the "Distribution" tab is only available to Team Members whose role is either "Agent" (the one who signed up for the iOS Developer Program), or "Admin" (those that the Agent grant access to app-distribution capabilities).
1b). if you're fairly certain you have an App Store Distribution Provisioning Profile installed in your Xcode profile library, you can verify it is an App Store profile as well as the App ID associated to it by using the steps in section How do I confirm my Provisioning Profile is for App Store distribution?
2). verify that your Scheme 'Archive' task is mapped to "Release" using the steps in section:
"Creating an Application Archive"
3). check that you have an your App Store provisioning profile assigned to your "Release" Code Signing Identity using the steps in section
"Assigning Provisioning Profiles to Build Configurations".
Note: it's important to make these changes at the Target level Build Settings, versus the Project level ones, as Target settings override Project ones...you can think of the Project level build settings as 'defaults' to populate target settings (and any future targets) with. Also, Ensure the "All" button is depressed in the upper-left corner of Target Build Settings to reveal the "Code Signing Identity" section.
4). retry your Product > Archive.
If the issue persists after the above, I recommend continuing onto Apple's complete list of potential causes of this error at the following URL "How do I resolve the error: Application failed codesign verification?"
My problem was solved when I noticed that I only had a "team" provisioning profile, and the details in iOS Dev Center told me that it was not a profile fit for development because it had no device attached. So I created a second provisioning profile, which let me check the box for my device so that it had a device attached.
Then when validating or submitting the app from the Organizer window (after pressing 'Build and archive'), I first made the mistake of selecting this new profile as the code signing profile. That was wrong. The profile that worked was iPhone Developer.
Good luck!
PS: This whole submission process is a heap of abacadabra. Do you really have to create a zillion distribution profiles, provisioning profiles, etc.? It hasn't encouraged me in any way to better test my app. I already did that before I chose to upload, and clicking a hundred buttons labeled 'Create','Download' and 'Submit' isn't really a quality control process that added anything (well except being forced to buy an iPad and test on that). Who ever said iOS was developer friendly?
My problem was that the Archive scheme did not have Build Configuration of App Store, but of Release. To change this, go to Product -> Edit scheme, select Archive on left side and change Build Configuration to App Store. I am assuming the code signing is configured properly (with distribution certificate).
You probably created a new certificate without refreshing the provisioning profiles
Create your iOS Distribution Provisioning Profile for App Store Distribution
I solved this by deleting the Archive that's not validating from the Organizer, closed and reopened Xcode and built for Archiving again.
I then chose Archive from the drop down menu. After doing that my app passed validation.
Hope that helps.

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?
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.
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 !
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/
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.
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.
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:
Close Xcode
Right-click on .xcodeproj file -> show package contents
Edit project.xcodeproj in a text editor
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.
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.
Toolchain for CMake users
In my case, locking and unlocking login-keychain from Keychain Access did the trick
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.
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.
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
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.
Maybe your mac's date and time are incorrect. Just correct them.

Took over iPhone development on an app from another developer and getting code signing error

I am able to get the software to build and run in the simulator and when I set it to device I get a code signing error as it has the previous developers code signature. How do I get it to use my provisioning profile.
Project > Edit Project Settings > Code Signing Identity

Not Jailbroken - getting Provisioning is not applicable for product type 'Application' in SDK Device

Codesign warning: provisioning is not applicable for product type 'Application' in SDK Device - iPhone OS3.1'; ignoring..
Redownloaded my developer certificate, made a new provisioning profile, still getting this error. Searched the Xcode project and removed all lines referencing a Provisioning Profile, but that didn't seem to remove it from the project settings (went to show package contents, then opened the project file).
Was originally on a different machine then transferred over, if that makes a difference?
Thanks
Check the file
/Developer/Platforms/iPhoneOS.platform/Info.plist
and make sure the following keys are set to YES
<key>PROVISIONING_PROFILE_ALLOWED</key>
<string>YES</string>
<key>PROVISIONING_PROFILE_REQUIRED</key>
<string>YES</string>
When developing for a jailbroken devices, these should normally be set to NO, so you can self sign and copy the file over, etc, but it's not necessary to skip this when you actually have a proper certificate and provisioning for your device.

provision file error in iPhone OS 2.2

I created an AppID "MyApp", DeviceID "MyDevice" in Program Portal and I downloaded the provision file and drag it to Organizer, downloaded the .cer file and install it on Mac.
All these works fine, but when I build my app, an error pops up saying "CodeSign error: a valid provisioning profile is required for product type 'Application' in SDK 'Device-iPhone OS 2.2'".
I tried to find PROVISIONING_PROFILE in project.pbxproj in myApp.xcodeproj, but it returns "Not Found". What might be the problem? Do I need to modifiy the info.plist and what should I modify?
The provisioning process for developing iPhone apps can be very confusing, and your error could be due to any of a number of issues. Here is a very thorough walkthrough:
http://www.24100.net/2009/02/iphone-sdk-mobile-provisioning-0xe800003a-0xe8000001/
I would suggest totally scrapping whatever provisioning profiles you have, erase them from XCode, and start over using this tutorial. That seems to work the best in most of my cases.