Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application failed codesign verification on Xcode 4.0.2 after repeatedly clearing keys, recreating project

I have been getting this problem for almost 4 hours now, getting very frustrated. I have gone through and revoked my certs and provisioning profiles 3 times now and started from scratch. I've also ensured my project was set to use the DISTRIBUTION profile. I revoked and deleted my development cert/prof just so I couldn't select it by accident. My mobileprofile is being copied correctly. I'm using Xcode 4.0.2. I started a new project and dumped my files in there and I get the same problem there..

I super-double-triple checked the directions to get certs. Created private keys, sent file to developer provisioning portal, got a cert back, it loads up and matches my private key.. have deleted all non relevant keys. Have deleted all old provisioning profiles that were saved in MobileProfile/..

here, really, my project is set up right!!

here, really, my project is set up right!!

here, really, my target (only target!) is set up right!

here, really, my target (only target!) is set up right!

Here's my keychain.. certs look good enter image description here

My super-slow-carefully-made provisioning profile shows up just fine in Xcode, it's certainly recognized as being good and signed

enter image description here

What I'm getting is:


rocessProductPackaging "/Users/rcl/Library/MobileDevice/Provisioning Profiles/AFFB40FF-FE57-4131-A1D1-0804E0E747FF.mobileprovision" /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app/embedded.mobileprovision
    cd /Users/rcl/Documents/iMan/iMan_On_Xcode402/iMan
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
     "/Users/rcl/Library/MobileDevice/Provisioning Profiles/AFFB40FF-FE57-4131-A1D1-0804E0E747FF.mobileprovision" -o /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app/embedded.mobileprovision

Then..

ProcessProductPackaging /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/Entitlements.plist /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Intermediates/iMan.build/Release-iphoneos/iMan.build/iMan.xcent cd /Users/rcl/Documents/iMan/iMan_On_Xcode402/iMan setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/Entitlements.plist -entitlements -format xml -o /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Intermediates/iMan.build/Release-iphoneos/iMan.build/iMan.xcent

Then...

CodeSign /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app cd /Users/rcl/Documents/iMan/iMan_On_Xcode402/iMan setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin/codesign -f -s "iPhone Distribution: Robert Lorentz" --resource-rules=/Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app/ResourceRules.plist --entitlements /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Intermediates/iMan.build/Release-iphoneos/iMan.build/iMan.xcent /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app

Then....

Validate /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app cd /Users/rcl/Documents/iMan/iMan_On_Xcode402/iMan 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/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app

warning: Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011) Executable=/Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app/iMan codesign_wrapper-0.7.10: using Apple CA for profile evaluation AssertMacros: signer, file: codesign_wrapper.c, line: 610 AssertMacros: profile, file: codesign_wrapper.c, line: 914 codesign_wrapper-0.7.10: Failed to load provision profile from: /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app/embedded.mobileprovision - (null)

Edit:

One note is that I have had Xcode 4.2 beta installed, not sure if that could be causing issues? I used the provided script and did a full uninstall of the beta developer tools and installed Xcode 4.0.2 again.

Edit:

I've tried generating the private keys in my own name and also my company's name, for 'Common Name'. I initially registered with the apple developer program with my own name, but when I set myself up on iTunes Connect I used my business name as the name I wanted to appear. It seems the CERTIFICATE I'm issued obviously uses my real name. I've tried setting the common name on private key to both things with no luck, but which is correct?

Edit:

And to be clear, the file /Users/rcl/Library/Developer/Xcode/DerivedData/iMan-hapawfvbfkeskkaembwcgifzypdz/Build/Products/Release-iphoneos/iMan.app/embedded.mobileprovision definitely exists and matches the md5sum of my ~/Library/MobileDevice/Provisioning Profiles../ file (the only one that exists, the one I want to use.)

Edit:

When creating my distribution provisioning profile, it doesn't seem to matter what I pick for my App ID - they all give the same results. Is there something that needs to match up with this App ID?

Edit:

Ok I'm "getting somewhere" or walking backwards. So my bundle ID specified by me has been com.panagiaindustries.iman ; apple issued me SR49T455EV.com.panagiaindustries.iman ... if I build my app with the com.pana... one, it fails to codesign within xcode. if I build with the SR49T... one, it codesigns, but when I use Application Loader I get 'Bundle identifier SR49T... differs from reserved bundle ID: com.pana...' as an error. Which SHOULD I be using?

Edit:

Adding the following entitlements file seemed to have no effect:






    get-task-allow
    
    application-identifier
    SR49T455EV.com.panagiaindustries.iman


like image 388
Nektarios Avatar asked Jul 22 '11 05:07

Nektarios


1 Answers

I had gone from Xcode 4.0.2 to 4.2.x beta, then back to 4.0.2. After this, Xcode wasn't working so I ran the "official perl" uninstaller script, then reinstalled 4.0.2. Xcode worked.. but apparently I was still using some beta tools. I resolved my problem by mv /Developer /Developer.old and install "fresh" 4.0.2.

like image 128
Nektarios Avatar answered Sep 28 '22 00:09

Nektarios