Xcode 4.4 - Resigning iOS Archive gives `Packaging Operation Failed`

Originator:evan
Number:rdar://11972932 Date Originated:2012-07-27
Status:Duplicate Resolved:03-Aug-2012
Product:Developer Tools Product Version:4.4 4F250
Classification:Other Bug Reproducible:Always
 
26-Jul-2012 08:57:
Summary:
Building any iOS project to Archive and then resigning with Organizer's "Distribute..." feature fails with Packaging Operation Failed.

Further background:
I believe this is somehow related to radar://11973031

I am a member of 4 developer teams (1 of which is an enterprise account).

Steps to Reproduce:

1. Open any iOS Xcode project
2. Build + Run in simulator -> works fine. Build + Run on development device -> works fine. Build + Archive
3. After build + archive, Organizer opens with Archives tab selected and newly archived build highlighted
4. Click "Distribute..."
5. Action sheet rolls down, select "Save for Enterprise or Ad-Hoc Deployment"
6. Select a provosining profile that matches your code sign credentials and the app bundle identifier
7. Click Next

Expected Results:

After step 7...
8. Save dialog box appears
9. Happiness

Actual Results:

After step 7...
8. Receive error message `Packaging Operation Fails`
9. Rage

Nothing is dumped into Console on failure

Regression:

This bug is avoidable if you select the provisioning profile in the target's build settings before build + archive. This workaround does not scale across a team of developers that are checking in / checking out xcodeproj files from SCM

Notes:

Screen shots included of:
- Code Sign drop-down selection box
- Organizer's installed Provisioning Profiles

26-Jul-2012 08:57 PM:
'Screen Shot 2012-07-27 at 8.38.01 AM.png' was successfully uploaded

26-Jul-2012 08:58 PM:
'Screen Shot 2012-07-27 at 8.38.58 AM.png' was successfully uploaded

03-Aug-2012 07:37 PM Apple Developer Bug Reporting Team :
This bug has been closed as Duplicate. The issue is being tracked under the Bug ID 12006125. To check the status of the original bug report, please visit the Related Problem section of the Problem Detail view of your closed duplicate bug. (Status: Open)

For further information on the status of the original bug report, please update your report directly <http://bugreport.apple.com> and we will provide you with any available information.

Comments

+1 for this. Happens to me too.

I believe the equivalent terminal command would be:

/usr/bin/xcrun -sdk iphoneos PackageApplication -v ${APP_PATH} -o /Users/jhollida/Desktop/Brainscape.ipa --sign {SIGNER_NAME} --embed ${CERT_TO_SIGN_WITH}

it will fail with an error like this one:

error: Codesign check fails : /var/folders/2l/wl86b0v92dq35_v21jtj_3zh0000gn/T/dZHK3Qf0Zb/Payload/Brainscape.app: valid on disk /var/folders/2l/wl86b0v92dq35_v21jtj_3zh0000gn/T/dZHK3Qf0Zb/Payload/Brainscape.app: does not satisfy its designated Requirement /var/folders/2l/wl86b0v92dq35_v21jtj_3zh0000gn/T/dZHK3Qf0Zb/Payload/Brainscape.app: explicit requirement satisfied


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!