XCode 4.3 codesign failed - iphone

H e l l o Everyone, after installing the last Xcode 4.3.1 I stuck with submitting apps. I can't archive apps for submitting. It says:
warning: Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate. (-19011)
Executable=/Users/YYYYYY/Library/Developer/Xcode/DerivedData/XXXX002-ekjbelaglwpkredizicvazolomgj/Build/Intermediates/ArchiveIntermediates/ZZZZ/InstallationBuildProductsLocation/Applications/ZZZZ.app/ZZZZ
AssertMacros: message, file: /SourceCache/codesign_wrapper_Sim/Security-1245/codesign_wrapper/codesign_wrapper.c, line: 495
AssertMacros: profile, file: /SourceCache/codesign_wrapper_Sim/Security-1245/codesign_wrapper/codesign_wrapper.c, line: 904
codesign_wrapper-0.7.10: Failed to load provision profile from: /Users/YYYYYY/Library/Developer/Xcode/DerivedData/XXXX002-ekjbelaglwpkredizicvazolomgj/Build/Intermediates/ArchiveIntermediates/ZZZZ/InstallationBuildProductsLocation/Applications/ZZZZ.app/embedded.mobileprov
- (null)
I've tried to put in provisioning profiles (renew them), but it does not help.
There is no such a warring during normal build, only during archiving. In organizer when I press renew it gets only developers provisioning profiles and not renewing ones for distribution. So I put the distribution profile manually.
I've tried also to fix the project - Code sign identity - putting there iPhone distributing provisioning profile, remove build and clean targets, remove DerivedData (just in case) like people advised and cleaning all targets and checked twice that certificate is not expired.
Fortunately I kept the previous version of XCode 4.2, and it works fine archiving the same project. But I would love to hear any suggestions how to make XCode 4.3 working. Thank you in advance.

I had exactly this problem last night and was tearing my hair out!
However, the clue is that the last line "Failed to load provision profile" has characters missing from the end ('mobileprov' instead of 'mobileprovision'). Mine did too. I think there's a character limit per line and if your directory or application name is too long it will fail to work properly.
I re-created the project with a shorter name and everything worked fine (after re-doing the provisioning, etc.).
Since that was my first app (and it was painful to submit!) this is a stab in the dark as to what the real cause is - so perhaps the more advanced users out there could tell me if I'm right or not? Or was the re-creation of the project more likely to have fixed the issue?
Richard

Related

Another 'no identities are available for signing' issue

So i'm attempting to submit my app to the app store and getting the 'no identities are available for signing' error.
Ive gone through and remade my distribution certificate about 5 times so far in the provisioning portal, re-downloaded it (through xcode) each time and to no avail it still gives me the error.
Ive adjusted the code signing in the build settings to be set to the 'iPhone Distribution: (my certificate name)' as well as making sure my bundle identifiers match.
Ive restarted XCode multiple times and nothing seems to be working.
ideas?
Have you tried cleaning your project? This oftentimes resolves such issues with my own projects.
Product ==> Clean

Why does Xcode auto-install a (duplicate and expired) certificate in the keychain? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
xCode 4 -reinstalls keychain certs that I delete
The question says it all in a nutshell.
When building a project in Xcode, I receive the error message from the Check dependencies step:
CodeSign error: Certificate identity 'iPhone Developer: xxxxx' appears more than once in the keychain. The codesign tool requires there only be one.
Problem is, this certificate identity is reinstalled whenever Xcode is launched. It is an expired certificate too, that causes extra confusion. So I delete it in keychain, and build the project and everything works.
Quit Xcode, restart, watching Keychain, and TA-DA! the expired certificate reappears.
I feel like I'm back on a virus-infected windows machine.
Since the project builds and executes properly when the cert is deleted, the only problem is the automatic installation xcode does.
Edit:
I think it's got to be related to an examination that xcode does of the keychain, for whatever reason. Then xcode decides to install the cert based on its checkup of keychain, though it's a faulty decision. I could probably solve this problem if I spent 24-48 hours, but I'm able to keep working, without quitting Xcode. :)
I had the same experience with XCode 3 (not 4) and removing the old certificate in Keychain only wouldn't work.
I also add to remove all of my old provisioning profiles using the old certificate with Organizer then quit XCode, remove the old certificate from Keychain and restart XCode.
Now it seems to work fine!
You might want to try the solution from xCode 4 -reinstalls keychain certs that I delete
Kind regards, Frank
Not sure what's causing this for you, but two things to try out:
Firstly ... Xcode has historically had some bugs in this area that are only cured by quitting Xcode, deleting stuff from keychain, rebooting OS X (really - no idea what's in XCode that can survive an app restart, but I've seen it happen), and then restarting XCode. I haven't seen any of those for well over a year, but could be a regression bug?
Secondly ... although it doesn't handle certs, if you're not already you should be using iPhone Configuration Utility (http://support.apple.com/kb/dl851) for the provisioning profiles part if possible - it often provides manual fixes for Xcode bugs in this area.
Oh, thirdly (nobody expects the spanish inquisition): if you check Console, it sometimes contains extra debugging / error info for the commandline tools in Xcode that deal with certs and cert-signing (including error messages that appear nowhere else)
Delete all your provisioning profiles liked to the expired certificate from organizer.
Go to the provisioning portal create the new certificate. After that for each provisioning profile, edit them by selecting the certificate checkbox on the edit page and save them, then re-download the profiles.
For posterity, here's the strategy to get around this problem in our automated build script:
Before building, move the ~/Library/MobileDevices/Provisioning Profiles directory aside
Check to see if the iPhone Configuration Utility is running and close it (certs always reappear if this app is open. In XCode 4.1 you need to close the organizer too.)
Run you build
Move the Provisioning Profiles directory back
Profit?

iOS codesign error

I continuously get the following warning when I build my iPhone application:
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
But my application still runs. Why is this occurring? Can someone help? I updated my application and the App Store approved it, but now it crashes everytime anyone runs it (after installing the update) and I have no idea why. And now, I can't even get this warning to go away.
Here's my todo list when I've run across this.
1) Clean all targets, exit Xcode, then go drag the build folder from your project to the trash.
2) 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.
3) 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).
4) Look at your Build Results on the failure and identify which profile it is actually using and make sure it is the right one.
It seems that this is a bug in Xcode, I have read somewhere people reporting that warning after upgrading it. I have the same problem, I can compile and run the App, I have already released the App to the AppStore, but I just can't get rid of that annoying warning.
I think you can have a try to reset Keychain, before I encounter a problem that show my certificate was expired or invalid and I can not run with mobile, then I reset Keychain, then it worked well.

Apple's Problematic Provisioning Portal

I have restarted this process about 4 times over the past 3 weeks. I have not succeeded in submitting my app to the store. Please help me! I just started over again tonight, I did it in this order:
Deleted everything referring to the IPhone in my Keychain,
Redownloaded the Distribution Certificate
Created a new app id called: com.myapp
Downloaded the Provision Profile and installed it into XCode.
Please note: I did not install an Entitlements.plist because I was told I didn't need one. Everything is looking good at this point.
Duplicated my "Release" Configuration and renamed "Distribution"
Under the Configuration of "Distribution", Code Signing Identity, I can see my Provision Profile it actually says: IPhone Distribution: My Name (for Application Identifiers: com.myapp)
So at this point at the bottom of the Project Info Window I see this:
The name (“common name”) of a valid code-signing certificate in a keychain within your keychain path. A missing or invalid certificate will cause a build error. [CODE_SIGN_IDENTITY]
So I realize I haven't altered my bundle name for my app, I change it to com.myapp, warning still doesn't go away. I tried adding in my prefix into the Bundle Identifier like this:
5JSF8843kJJ.com.myapp (for example)
But the error still doesn't go away!
After all this I try to Build and Run on my device anyway thinking it may go away. But I get this error:
The iPod “myIpod” doesn’t have the provisioning profile with which the application was signed.
Click “Install and Run” to install the provisioning profile “myprofile” on “myIpod” and continue running “myappname.app”.
Please Help! I need to get this to work!
Thank you for your time.
UPDATE: I have fully tested the app and I am ready to distribute, I am trying to get a successful Build so that I can zip up my .app file and submit it using Application Loader.
You can't run an app using the Distribution certificate or Distribution Build.
You shouldn't duplicate your Release Build until after you get it running and configured exactly as needed, except for the choice of code signing certificate.

The executable was signed with invalid entitlements (iPhone build)

Ok I'm no rookie to this stuff. I know what I'm doing, so please dont take me through the basics. I updated Xcode to the newest version the other day, and now every new project and saved projects from the past that HAVE succesfully been built using its own distribution certificate are no longer succeeding with the following error:
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016).
This is happening to ALL my apps! I have six of them, and all of them have never had problems with their certificates, but now I'm getting this error! I'm not even making adhoc builds, so Im not using entitlements, nor is it specified in the code signing entitlements box. That box is blank. Ive tried everything, this is definitely an Xcode issue with updating.
Please help this is extremely frustrating.
This is just a shot in the dark, but maybe try deleting all of your provisioning profiles from Xcode and all of your devices, then download them again from the provisioning portal and reinstall them on everything? I ended up doing that anyway when I upgraded.
In my case I had "code signing" line in my targets and project build settings. Despite it was empty it was still giving me this error, until I deleted it completely in targets and partially in project. So that is what I did:
In Xcode 4.2 I went to my PROJECT\Build Settings found that line "code signing", clicked on it and in Entitlements deleted all lines (they were empty but still there!), so Entitlements disappeared.
I put in "code signing identity":don't code sign
"debug":don't code sign
"Any iOS SDK": choose your provisions here, I used automatic, worked fine
"release":don't code sign
"Any iOS SDK": same as above
Then I went to TARGETS\Build Settings, found the line "code signing" and deleted everything under it so it disappeared from targets.
Now I could build onto the device, not only in simulator.
Hope it helps somebody.
B