Xcode 10, Command CodeSign failed with a nonzero exit code

后端 未结 30 2704
忘掉有多难
忘掉有多难 2020-12-02 05:49

Everytime I build console is showing this message.

CodeSign /Users/admin/Desktop/AppStoreBuild/Project201/build/Debug-iphonesimulator/Project.app (in

相关标签:
30条回答
  • 2020-12-02 06:08

    The solution for me was restarting macOS without saving

    0 讨论(0)
  • 2020-12-02 06:09

    May sound stupid, but, try with no password, when it asked.

    0 讨论(0)
  • 2020-12-02 06:12

    Fix

    Remove extended file attributes in your resource files for good, not in the compiled application bundle:

    1. Open Terminal

    2. Change directory to the root of your source files

      $ cd /Users/rjobidon/Documents/My\ Project

    3. List all extended attributes

    $ xattr -lr .
    
    1. Remove all extended attributes
    $ xattr -cr .
    

    Xcode errors

    • "Command CodeSign failed with a nonzero exit code"
    • "Resource fork, Finder information, or similar detritus not allowed"

    Cause

    Apple introduced a security hardening change, thus code signing no longer allows any file in an app bundle to have an extended attribute containing a resource fork or Finder info.

    Sources

    • https://developer.apple.com/library/archive/qa/qa1940/_index.html
    0 讨论(0)
  • 2020-12-02 06:12

    I will post my solution. This solution worked for me, since none of the previous worked. The issue first occurred right after last update of XCode cli toolset (not sure if this is the confirmation bias).

    I tried some of the instructions (ie. Unlock Keychain Trick).

    What worked for me in a case of error:

    • Command CodeSign failed with a nonzero exit code (Something.framework)

      • Trash DD Content; rm -rf /Users/dx/Library/Developer/Xcode/DerivedData/*
      • Restart XCode
      • Build Phases => Link Binary With Libraries
        • Something.framework,
      • Set embed value in General => Something.framework => EMBED
        • Do not embed
      • Press Cmd+B (Build Project)
      • Hopefully Built Successful
    0 讨论(0)
  • 2020-12-02 06:13

    After trying everything, my solution was removing some PNG files, build and run (ok) and adding again the PNG images. Weird!

    0 讨论(0)
  • 2020-12-02 06:13

    None of the above solutions worked for me. After some guess work, I tried (Xcode v10.2.1 cocoapods v1.7.1)

    pod deintegrate
    

    followed by

    pod install
    

    Then:

    • Opened the workspace in Xcode
    • Cleaned build folder
    • Build the project

    No build errors.

    0 讨论(0)
提交回复
热议问题