xcodebuild - codesign -vvvv says"resource envelope is obsolete"

Grantism picture Grantism · Sep 24, 2014 · Viewed 19.4k times · Source

I've just updated my xcode install to use xcode 6.0.1 in order to start compiling my app for ios8 devices. For some reason I am not able to ever sign the app file correctly that is generated using the following:

xcodebuild -project GrantM/GrantM.xcodeproj -configuration Release

it compiles the code and appears to be fine, but running:

/usr/bin/codesign --verify -vvvv GrantM/GrantM.app

give me:

Program /usr/bin/codesign returned 1 : [GrantM/GrantM.app: resource envelope is obsolete]
Codesign check fails : GrantM/GrantM.app: resource envelope is obsolete

checking that the code was signed at all using: /usr/bin/codesign -dv GrantM/GrantM.app

returns:

Executable=Documents/GrantM/GrantM/GrantM.app/GrantM
Identifier=com.grantapps.GrantM
Format=bundle with Mach-O universal (armv7 (16777228:0))
CodeDirectory v=20200 size=647 flags=0x0(none) hashes=23+5 location=embedded
Signature size=4336
Signed Time=24 Sep 2014 12:54:53 pm
Info.plist entries=34
TeamIdentifier=N3KKU46JLY
Sealed Resources version=2 rules=5 files=55
Internal requirements count=1 size=180

has anyone else run into similar issues on OSX 10.9.5 & xcode 6.0.1? Or am I just being a bit stupid and doing something obvious wrong?

additionally, I was able to find the debug version of the app generated in xcode and could sign that successfully, but it being a debug version it won't work for distrobution. I can't even manually sign the xcodebuild generated app file.

thanks for any help or advice in advance.

Answer

Omkar picture Omkar · Oct 5, 2014

If you are using Mac OSX 10.9.5 or later, then there is an issue with OS codesigning with V2 signature.

So, use --no-strict flag with codesign --verify to get over this error.

If you're using PackageApplication to create an .ipa file, then

Edit the PackageApplication perl script tool using vi PackageApplication command and update codesign function occurrences to pass --no-strict parameter.

Example:

my $result = runCmd("/usr/bin/codesign", "--verify", "--no-strict", "-vvvv", , $plugin );

I was facing same and got the following response from Apple Dev Team. The issue is resolved for me.

The command line tool “codesign” has changed in 10.9.5 and 10.10, you need to pass “--no-strict” option to the command, (the problem has been reported and will be fixed). To workaround the problem, please save a copy and modify PackageApplication to pass “—no-strict” to codesign, you can locate PackageApplication by running the following: xcrun -sdk iphoneos -f PackageApplication