Code Sign error - code sign failed with exit code 1

Discussion in 'iOS Programming' started by whitedragon101, Apr 12, 2017.

  1. whitedragon101 macrumors 65816

    Sep 11, 2008
    I am having trouble with a code sign error. Initially I did the normal things, I checked my keychain for expired certificates and deleted them all (the red marked expired ones). Then I went into my developer profile on the online portal and I still had an in date certificate but my provisioning profile had expired. I regenerated a new provisioning profile downloaded it and uploaded it into Xcode. I still get the following error :

    code sign error.jpg

    I think the problem is where it says

    Signing Identity: "-"

    I don't know where this variable would be. I have changed the build settings for "Code Signing Identity" in both the project and target (just using the drop down settings that appear). I tried setting everything to the downloaded provisioning profile, then tried using the "Automatically Manage Signing" option in the general tab and setting everything to automatic. Still no dice. I now feel like I am just randomly flicking them back and forward now trying to get a lucky combination. If you know where I can find this particular

    Signing Identity: "-"

    variable the message is indicating and how to fix it I would be eternally grateful :)

    Many thanks
    --- Post Merged, Apr 12, 2017 ---
    This is totally bizarre that the clean command doesn't do this but I managed to find the answer eventually on stack overflow. I don't know how this happened what the fix does or how it works but it does. If anyone knows what this is doing or how it happens that could be useful information :

    In terminal, goto project's root directory and execute one by one command

    find . -type f -name '*.jpeg' -exec xattr -c {} \;
    find . -type f -name '*.png' -exec xattr -c {} \;
    find . -type f -name '*.tif' -exec xattr -c {} \;

    Clean Xcode and Re Build. Done.
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    This is explained in the stack overflow link you posted and this Apple QA

    Essentially Apple has tightened up the rules for code signing so that files that are in the app package cannot have certain kinds of extended attributes. Those extended attributes are a kind of holdover from an earlier time when certain kinds of metadata were routinely attached to files in the resource fork and then later in xattrs. The commands you show recursively search for image files and delete any xattrs they may have.

    The error message about this says "resource fork, Finder info, or similar detritus not allowed."

    The Apple QA shows some other terminal commands that are a little simpler than the ones you used but do the same thing.

    I'm pretty sure that git doesn't manage xattrs so if you're using git you'll probably have a workspace without any.

Share This Page