Xcode - Sharing app - PackageApplication failed with exit code 1
Asked Answered
D

4

17

I've created an ad hoc distribution build for my iPhone app using Xcode 4.1. The target successfully builds and produces an archive file that I can see in Organizer. I then click 'Share' which allows me to select .ipa and my distribution profile. However, after i hit 'Next' the Organizer crashes with the error below. The error log appears to suggest that the error is related to the 'ResourceRules.plist'? I'm using CorePlot for graphing, might it be related to that?

For info, I have a valid distribution certificate and imported a distribution provisioning profile. Entitlements file is not needed anymore for ad hoc distribution apparently so I don't have one in the project. All of my other apps don't crash at the 'sharing' stage, so it doesn't appear to be a problem with Xcode, just this particular app.

Any help much appreciated.

Grant.

PackageApplication failed with exit code 1.

Packaging application: '/Users/gabt/Library/Developer/Xcode/Archives/2011-08-20/myApp   20-08-2011 14.11.xcarchive/Products/Applications/myApp.app'

Arguments: embed=/Users/gabt/Library/MobileDevice/Provisioning Profiles/FA16C6A9-603C-46A6-8B98-F367A6B056CD.mobileprovision  verbose=1  output=/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/670E174E-0BCA-4F18-AB8D-5ACF3D7E569A-8458-000005FCA81C6AE5/app.ipa  sign=iPhone Distribution: Grant Abt  

Environment variables:

HOME = /Users/gabt

LOGNAME = gabt

__CF_USER_TEXT_ENCODING = 0x1F5:0:0

DISPLAY = /tmp/launch-WoNf6c/org.x:0

COMMAND_MODE = unix2003

VERSIONER_PERL_PREFER_32_BIT = no

PATH = /Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin

SHELL = /bin/bash

SSH_AUTH_SOCK = /tmp/launch-hHkBrJ/Listeners

Apple_PubSub_Socket_Render = /tmp/launch-P0dtgN/Render

TMPDIR = /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/

USER = gabt

VERSIONER_PERL_VERSION = 5.12

Output directory: '/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/670E174E-0BCA-4F18-AB8D-5ACF3D7E569A-8458-000005FCA81C6AE5/app.ipa'

Temporary Directory: '/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS'  (will NOT be deleted on exit when verbose set)

+ /bin/cp -Rp /Users/gabt/Library/Developer/Xcode/Archives/2011-08-20/myApp 20-08-2011 14.11.xcarchive/Products/Applications/myApp.app /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload

Program /bin/cp returned 0 : []

### Checking original app

+ /usr/bin/codesign --verify -vvvv /Users/gabt/Library/Developer/Xcode/Archives/2011-08-20/myApp 20-08-2011 14.11.xcarchive/Products/Applications/myApp.app

Program /usr/bin/codesign returned 0 : [/Users/gabt/Library/Developer/Xcode/Archives/2011-08-20/myApp 20-08-2011 14.11.xcarchive/Products/Applications/myApp.app: valid on disk

/Users/gabt/Library/Developer/Xcode/Archives/2011-08-20/myApp 20-08-2011 14.11.xcarchive/Products/Applications/myApp.app: satisfies its Designated Requirement

]

Done checking the original app

### Embedding '/Users/gabt/Library/MobileDevice/Provisioning Profiles/FA16C6A9-603C-46A6-8B98-F367A6B056CD.mobileprovision'

+ /bin/rm -rf /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app/embedded.mobileprovision

Program /bin/rm returned 0 : []

+ /bin/cp -rp /Users/gabt/Library/MobileDevice/Provisioning Profiles/FA16C6A9-603C-46A6-8B98-F367A6B056CD.mobileprovision /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app/embedded.mobileprovision

Program /bin/cp returned 0 : []

+ /usr/bin/codesign -d --entitlements /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/entitlements_rawMkZVbU5I /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app

Program /usr/bin/codesign returned 0 : [Executable=/private/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app/myApp

]

+ /usr/libexec/PlistBuddy -c Set :get-task-allow NO /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/entitlements_plistt2Evi2T_

Program /usr/libexec/PlistBuddy returned 0 : []

+ /usr/bin/plutil -lint /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/entitlements_plistt2Evi2T_

Program /usr/bin/plutil returned 0 : [/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/entitlements_plistt2Evi2T_: OK

]

### Codesigning '/Users/gabt/Library/MobileDevice/Provisioning Profiles/FA16C6A9-603C-46A6-8B98-F367A6B056CD.mobileprovision' with 'iPhone Distribution: Grant Abt'

+ /usr/bin/codesign --force --preserve-metadata --sign iPhone Distribution: Grant Abt --resource-rules=/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app/ResourceRules.plist --entitlements /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/entitlements_plistt2Evi2T_ /var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app

Program /usr/bin/codesign returned 1 : [/var/folders/jw/s5ky0r1n34322jt4pw3047m00000gn/T/y30BrfbtxS/Payload/myApp.app/ResourceRules.plist: cannot read resources

]

error: codesign failed with error 1
Diverge answered 21/8, 2011 at 13:23 Comment(1)
same here after i downgraded from xcode4.2 to xc4.1. did you also downgrade?Bumgarner
N
47

Had the same problem today.. The "Code Signing Resource Rules Path" was missing in the PROJECT - Build Settings

... Opened the "Build Settings" tab of your project. Searched "Code Signing Resource Rules Path", it was empty for me and added $(SDKROOT)/ResourceRules.plist

credits goes to Adams Blair who described this problem with SDK2.2

Nescience answered 27/10, 2011 at 16:23 Comment(3)
Doesn't fix it for me with Xcode 6.1. We are using xcodeproj ruby gem to generate the Xcode project, that might be another reason why ResouceRules.plist is missing... We are stuck with gem version 0.14.1 while latest is 0.19.1Inmate
I stand corrected. $(SDKROOT)/ResourceRules.plist actually works both for Xcode 6.0.1 and 6.1. In my case ResourceRules.plist was not copied, because app was built for iphonesimulator SDK so it wasn't signed in the end. To fix the problem I had to add -sdk iphoneos flag for xcodebuild.Inmate
This was not a working solution for me in the Xcode 5-6 era, however, Xcode 6.1 indeed wants this added in build settings. Thanks for saving the future ;)Decastere
F
11

yeah, i think it's xcode6.1 problem (or bug?)

you can

1.add $(SDKROOT)/ResourceRules.plist to "Code Signing Resource Rules Path"

or

2.use xcode-select back to 6.01 build

or

3.sign argument without "sign=iPhone Distribution: Grant Abt"

to work

Filomena answered 8/10, 2014 at 16:23 Comment(2)
Perhaps you could format your answer a bit nicer with some blocks?Indices
Was running into this issue. Step 1 (explicitly adding the ResourceRules.plist) fixed it.Androcles
M
0

Check your code signing profiles again. Your developer profile should be set to the debug and for the release you must set your distribution profile. Make sure you select any iOS SDK under each category and set the respective profiles for them as well.

Morph answered 24/8, 2011 at 6:3 Comment(0)
M
0

Encounter this issue when testing with Xcode 6.1 beta version. Back to Xcode 6.0.1 works.

Mewl answered 2/10, 2014 at 10:24 Comment(6)
@Mewl I was in the same situation as you and as MiroslavKovac suggested it worked for me.Anticlinorium
Running in the same problem with Xcode 6.1. Have no ResourceRules.plist after the build. Using $(SDKROOT)/ResourceRules.plist didn't help.Inmate
I stand corrected. $(SDKROOT)/ResourceRules.plist actually works both for Xcode 6.0.1 and 6.1. In my case ResourceRules.plist was not copied, because app was built for iphonesimulator SDK so it wasn't signed in the end. To fix the problem I had to add -sdk iphoneos flag for xcodebuild.Inmate
I tried Xcode 6.1 on OSX 10.9, seems the accepted answer not work for me.Mewl
I tried doing this but couldn't get it to work. I ended up editing PackageApplication to remove the deprecated switch. I added -sdk iphoneos to the xcodebuild and still no go. Any other ideas?Lend
I am on xcode 6.3 and can't find a way to apply the suggested answer, what is the alternative to the "Code Signing Resource Rules Path" solution?Calculating

© 2022 - 2024 — McMap. All rights reserved.