Xcode 10, Command CodeSign failed with a nonzero exit code

后端 未结 30 2837
忘掉有多难
忘掉有多难 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:18

    This is because Code signing no longer allows any file in an app bundle to have an extended attribute containing a resource fork or Finder info.

    To see which files are causing this error, go to .app folder, normally is like: /Users/XXXX/Library/Developer/Xcode/DerivedData/MyProject-ckbzynxqjmstxigbdwwkcsozlego/Build/Products/Debug-maccatalyst/ (mine is Catalyst project) In Terminal,

    cd 
    xattr -lr .
    

    You will see some files has extended attribute:

    ./MyProject.app/Contents/Resources/shopping_cart.png: com.apple.lastuseddate#PS: 00000000 BE 31 D5 5E 00 00 00 00 D0 40 FE 39 00 00 00 00 |.1.^.....@.9....|

    Then go to your project folder or referenced folder for those files, remove extended attribute:

    cd /Users/XXXX/Work/MyProject
    xattr -cr .
    

    After clean all referenced folders, go to Xcode and rebuild.

提交回复
热议问题