13

I have recently made the update of mac OS from 10.11 to 10.12 and i can't signing my iOS applications in Xcode 8.0 anymore.

I get this error :

CodeSign /Users/aymericpitre/Library/Developer/Xcode/DerivedData/OrpiDirect-ghphwnhfbtdulhgauptikzmsrqdi/Build/Products/Debug-iphoneos/OrpiDirect.app

cd /Users/aymericpitre/Documents/projets/Ville-de-lyon-iPhone/VilleDelyon_git/ville_de_lyon

export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer: aymeric xxxx (SYC4JR6K8G)"
Provisioning Profile: "VDL-sierra"
                      (756b4f3a-26aa-4937-ba40-4cc4eea03e92)

/usr/bin/codesign --force --sign D60599B3AE74EE1D4863C249026FA28545A07689 --entitlements /Users/aymeric/Library/Developer/Xcode/DerivedData/OrpiDirect-ghphwnhfbtdulhgauptikzmsrqdi/Build/Intermediates/OrpiDirect.build/Debug-iphoneos/OrpiDirect.build/OrpiDirect.app.xcent --timestamp=none /Users/aymeric/Library/Developer/Xcode/DerivedData/OrpiDirect-ghphwnhfbtdulhgauptikzmsrqdi/Build/Products/Debug-iphoneos/OrpiDirect.app

Command /usr/bin/codesign failed with exit code 5

The provisioning profile seems to be ok because i find it in the Xcode/preferences/accounts window.

I've tried to run xattr -c * command inside derived folder but it doesn't work.

6
  • Did you find a solution? Commented Oct 2, 2016 at 4:43
  • No :( I think i'm going to install El Captain on another boot partition and install Xcode on it. Next time I will use Time machine before making the OSX update ! Commented Oct 3, 2016 at 9:49
  • I couldn't find a solution. I tried the same procedure on another machine and I had success. I think something got corrupted, but I don't know what. Commented Oct 3, 2016 at 20:23
  • I will make a clear new installation this week-end I will let you know. Thanks a lot for trying ;) Commented Oct 4, 2016 at 8:10
  • I have already made a new installation of xcode but i m getting the same problem. Xcode was working fine before installing Sierra but after that it is giving me that error whenever I archive or run it on device. Can somebody help? Commented Oct 19, 2016 at 20:21

5 Answers 5

3

I finally make it work. After digging into the internal logs, I realized that the problem came from the keychain. I tried to delete all the entries with the GUI, but one couldn't be deleted (named "1")

So I had to delete all the keychain folder:

rm -rf /Users/my_user/Library/Keychains

Rebooted the mac, installed keys again, and everything worked as expected.

Disclaimer: First make a backup of all the needed keys! (export before delete) For any service like Chrome sign-in, you will need to enter your credentials again

Sign up to request clarification or add additional context in comments.

3 Comments

This worked for me. I had the same thing with that first "1" key causing Keychain to crash upon trying to delete it. After backup, removing all, and reinstalling, was once again able to codesign. Many thanks for posting! Have forwarded this to Apple.
Passing on a note at Apple dev forums that just deleting the buggy "1" key also may work.
This worked for me to. I just deleted the "1" mystery key and it was ok. Very well down Alex R. R. and thanks so much !
2

I have a very dreadful answer of this. I dont know what was corrupted in my system but after so many reinstallation and deletion of xcode still didn't solve the issue. So I formatted my hdd and reinstall mac OS Sierra and xcode 8 and that solved the issue

Comments

1

Try under Window tab => Organizer, the provisioning that are in your device. Then re-add them (download them again on the apple website). And try to compile again.

Comments

0

Xcode 8 allows you automatic signing. You need to select your target in settings -> General. And you will see the checkbox like on the image:

enter image description here

When you check this checkbox, you will need to choose your team (like in red rectangle on the image). After that Xcode will create a team provision profile for your application, and your application will be signed automatically.

P.S. I you don't see your team in the team dropbox like on the image, you need to Xcode -> Preferencies:

enter image description here

After that you need to enter "Accounts" tab -> tap + button:

enter image description here

After that you the team with your developer account will appear in the Team dropbox like on the 1st image.

Comments

0

I deleted a key named "1" in keychain access.

Then xcode has become to work!

3 Comments

Hi.. Please try not to duplicate answers. User Alex R. R., answered this last year
its not a duplicate, as i managed to delete ONLY "1" and then it worked. no need to remove everything
@jose920405 i am not duplicate the AlexR. R. answer,this is my own experiment,then i am not suggest to delete all keychains.I just said delete the 1 named keychain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.