0

I have no idea why does this error appear when doing the final run for distribution before submitting to the iTunesConnect:

/Users/Val/Library/Developer/Xcode/DerivedData/Mathematics-dzakmzlewrmgvibasvuixiwmkwwp/Build/Products/Debug-iphoneos/Mathematics.app: replacing invalid existing signature
/Users/Val/Library/Developer/Xcode/DerivedData/Mathematics-dzakmzlewrmgvibasvuixiwmkwwp/Build/Products/Debug-iphoneos/Mathematics.app: CSSMERR_TP_NOT_TRUSTED
Command /usr/bin/codesign failed with exit code 1    

All of my certificates/profiles were made 2 minutes ago.
I read from another question that I should remove unneeded spaces from info.plist but there are no such!
I should note that I am running Xcode 4.1, reinstalled today.

Peter V
  • 2,478
  • 6
  • 36
  • 54
  • 1
    This thread is old but might be of some help: https://discussions.apple.com/thread/1630090?start=0&tstart=0 – E.Freitas Sep 07 '11 at 18:09
  • Setting Trust for your certificates to system default may help. http://www.iphonedevsdk.com/forum/iphone-sdk-development/76785-codesign-error-cssmerr_tp_not_trusted-codesign-failed-exit-code-1-a.html – E.Freitas Sep 07 '11 at 18:12
  • I did set it right but the problem still persists :/ – Peter V Sep 07 '11 at 18:30
  • have you followed the steps provided in the Distribution section of your Apple's Account? – Wasim Sep 07 '11 at 20:28
  • yes! even recreated everything today! – Peter V Sep 07 '11 at 20:38
  • possible duplicate of [Command /usr/bin/codesign failed with exit code 1](http://stackoverflow.com/questions/2017756/command-usr-bin-codesign-failed-with-exit-code-1) – Brad Larson Sep 07 '11 at 22:08

3 Answers3

3

CSSMERR_TP_NOT_TRUSTED Command /usr/bin/codesign failed with exit code 1

Yes, open Keychain.app & the Distribution Certificate, change the trust to "use system default.

Devaski
  • 411
  • 6
  • 14
1

There is no single answer to this problem, partly because Apple's error message(s) is/are not terribly specific.

For my case the solution was this:

Open this Perl script:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication

and insert this line near the top, like right after the "my $xxxx" declarations:

$ENV{CODESIGN_ALLOCATE} = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate';

Credit to http://loopingrecursion.com/index.php?t=codesign for this answer.

The problem seemed to arise after installing some XCode 4.2 beta 7. I eventually uninstalled that one and reinstalled 4.1 from scratch but still couldn't Validate or Share, until I employed this fix.

ZeroDiv
  • 290
  • 1
  • 5
0

I had the same problem, I solved it using just Build Active Architecture Only option in the project info.

Alaa Eldin
  • 2,178
  • 4
  • 21
  • 24