Programing

macOS High Sierra Xcode의 코드 서명 오류-리소스 포크, Finder 정보 또는 이와 유사한 장치는 허용되지 않습니다

lottogame 2020. 4. 13. 08:08
반응형

macOS High Sierra Xcode의 코드 서명 오류-리소스 포크, Finder 정보 또는 이와 유사한 장치는 허용되지 않습니다


이미 시도 : macOS Sierra, Xcode 8의 코드 서명 오류

오류를 보여주는 이미지를 참조하십시오 여기에 이미지 설명을 입력하십시오

CodeSign /Users/gururajtallur/Library/Developer/Xcode/DerivedData/Flow-bkqjkvtmvjovpyepfjeyqmjpintj/Build/Products/Debug-iphoneos/Super\ Flow\ Flip.app
    cd "/Volumes/Development/Project/Top Best Games/19. Lets Flow/35/let's FLOW - source/proj.ios_mac"
    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 Distribution: New Free Games (2CHN583K4J)"
Provisioning Profile: "Super Flow Flipp AppStore"
                      (c6c30d2a-1025-4a23-8d12-1863ff684a05)

    /usr/bin/codesign --force --sign E48B98966150110E55EAA9B149F731901A41B37F --entitlements /Users/gururajtallur/Library/Developer/Xcode/DerivedData/Flow-bkqjkvtmvjovpyepfjeyqmjpintj/Build/Intermediates/Flow.build/Debug-iphoneos/Super\ Flow\ Flip.build/Super\ Flow\ Flip.app.xcent --timestamp=none /Users/gururajtallur/Library/Developer/Xcode/DerivedData/Flow-bkqjkvtmvjovpyepfjeyqmjpintj/Build/Products/Debug-iphoneos/Super\ Flow\ Flip.app

/Users/gururajtallur/Library/Developer/Xcode/DerivedData/Flow-bkqjkvtmvjovpyepfjeyqmjpintj/Build/Products/Debug-iphoneos/Super Flow Flip.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

코드 서명 섹션에서 프로파일과 인증서를 선택할 수 있지만 여전히 오류가 발생합니다. 여기에 이미지 설명을 입력하십시오

여기에 이미지 설명을 입력하십시오

이 문제를 해결하는 방법?


해결책 1 :

Apple Developer Website 위의 문제에 대한 답변 여기를 클릭하십시오 .

터미널에서 아래 명령을 실행하십시오 : 첫 번째 goto 프로젝트 루트 폴더

 xattr -cr <path_to_project_dir>

Xcode를 정리하고 다시 빌드하십시오. 건배

해결책 2 :

파인더 정보를 보유한 파일을 찾아서이 문제점을 해결할 수 있습니다.

터미널에서 프로젝트 루트 디렉토리로 이동하여 실행하십시오.

ls -alR@ . > kundapura.txt

현재 디렉토리에 kundapura.txt가 생성됩니다. 이제 com.apple.FinderInfo를 검색하고 모든 파일에 대해이 속성을 지우십시오. 당신은 이렇게 할 수 있습니다

xattr -c <filename>

예: xattr -c guru.png

모두 지우면 코드 서명이 작동합니다. Xcode를 정리하고 다시 빌드하십시오. 건배

해결 방법 3 : Mark McCorkle의 답변에서 영감을 받음

터미널에서 프로젝트의 루트 디렉토리로 이동하여 하나씩 명령을 실행하십시오.

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

Xcode를 정리하고 다시 빌드하십시오. 끝난.


이미지 파일 내의 속성에서 오류가 발생했습니다. 이것은 그래픽 디자이너가 Photoshop에서 이미지를 속성으로 저장하여 발생했습니다.

다음은 모든 png 파일을 찾아 해당 속성을 제거하는 간단한 명령입니다. 터미널의 프로젝트 루트 디렉토리에서 이것을 실행하십시오. 청소 및 재건; 문제 해결됨.

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

앱을 공동 디자인 할 때이 오류가 발생하는 경우 :

리소스 포크, 파인더 정보 또는 이와 유사한 디트 리터 스가 허용되지 않음 명령 / usr / bin / codesign이 종료 코드 1로 실패

프로젝트 루트 폴더로 이동하여 실행하십시오.

find . | xargs -0 xattr -c

모든 파일의 속성이 지워집니다.

Sierra에서는 서명 된 번들에있을 수있는 규칙이 강화되었으며 더 이상 리소스 포크가 허용되지 않습니다. AppleScript는 오랫동안 정보를 사용하지 않았지만 리소스 포크에 정보를 영원히 저장해 왔습니다. Sierra를 사용하면 스크립트를 저장할 때이 리소스 포크 정보가 더 이상 저장되지 않습니다.

이는 Sierra 이전 버전에서 마지막으로 저장된 스크립트를 공동 디자인 할 수 없음을 의미합니다. Sierra에 로그인하려면 Sierra에 저장해야합니다.

영향을받을 가능성이있는 사람들은 다른 스크립트를 자신의 스크립트에 묶는 사람입니다 (코르도바?). 임베디드 스크립트가 모두 Sierra에서 다시 저장 될 때까지 컨테이너 스크립트에 서명 할 수 없습니다.

최신 정보:

이것도 효과가있는 것 같습니다 :

xattr -rc .

권한 오류가 충분하지 않은 경우 sudo를 앞에 추가하십시오. sudo xattr -rc .


The easiest way to handle attributes on your source files is to have Xcode clear up the archive before it runs codesign. To do this:

  1. Select your target in XCode
  2. Select the Build Phases tab
  3. Press the + symbol
  4. Select New Run Script Phase
  5. Enter the following for the script:

    xattr -cr ~/Library/Developer/Xcode/DerivedData || echo Clear

Now when you build your target it will clear out any attributes that would have broken codesign. By clearing out at this stage you don't have to alter your source code / project directory.

The "|| echo Clear" part of the script ensures that the project build continues even if xattr errors.

This method is good if you use programs such as DropBox on your code repository that add the attributes, as it doesn't change your source project, only the built archive.

You may need to change the path to match your DerivedData directory - this path will be shown next to the codesign error.

xattr codesign xcode 수정


There is official Apple answer for this issue in Technical Q&A QA1940.

This is a security hardening change that was introduced with iOS 10, macOS Sierra, watchOS 3, and tvOS 10.

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, run this command in Terminal: xattr -lr <path_to_app_bundle>

You can also remove all extended attributes from your app bundle with the xattr command: xattr -cr <path_to_app_bundle>

<path_to_app_bundle> can be replaced with directory of your Xcode project. For example ~/Development/MyProject


I have used following command. Use terminal window. Navigate to your Project and execute following:

xattr -rc .

All about clearing files is fine, but tedious for multiple projects.

graphics apps, (like photoshop in old versions) write additional info (we now call it metadata..) in an old fashion in external files, or they came frm older OSX, files like:

"com.apple.ResourceFork" and "com.apple.FinderInfo", when unzipping folder, for example.

Xcode 8 refuses to add it to a build (as You added them to a project with a "git --add ." maybe..) You can find in terminal recursively and delete them, but can be tedious.

I wrote a small free utility to delete it.. hope it can help..

https://itunes.apple.com/us/app/cleandetritus/id1161108431?ls=1&mt=12


Simple solution:-

How I did [Working for me]

Step 1:- Go to this folder - from your finder press option Go - > Go to Folder

then type your project path like this example:- Library/Developer/Xcode/DerivedData/yourprojectname/Build/Products/Debug-iphoneos

Now you can see a window pop with list of available File, There you see yourApp.app file [ Don't do anything just wait for step 2].

Step 2:- Open new Terminal and type just cd then just drag step 1 yourApp.app to terminal, now you will get the path for the app, now press enter button.

Step 3:- Now type this command **

xattr -rc .

Don't miss "."(Dot) press enter button.

That's it, Go to your Xcode project and clean and run again.


For those (like me) who are just trying to develop an app without having to strip extended attributes on every new photoshop created PNG added to the macOS target, you can temporarily disable code signing by adding a user defined build setting:

CODE_SIGNING_ALLOWED = No 

Obviously, one distributing an app needs to eventually deal with the issue but this enables development in cases like mine where it wasn't necessarily straightforward to omit code signing in Sierra (on past OS X / Xcode it was easier to do so).

Per RGriffith's comment, here are a few screenshots for those who aren't sure how the custom build setting is added.

여기에 이미지 설명을 입력하십시오

여기에 이미지 설명을 입력하십시오


-----In case you can't apply the solutions above, because of lack of bash knowledge or something else.

I had this problem as soon as I enabled iCloud Drive on my Sierra. And my project was in a folder which was synced with iCloud Drive. I suppose this is what adds those additional attributes.

Temporary solution:

Disable iCloud Drive for the folder where your project is.


You will need to delete the app bundle folder and rebuild the app as explained below.

My app is called: augment

In terminal window, goto your app folder e.g.: cd /Users/username/Library/Developer/Xcode/DerivedData/

In terminal window run command for your app folder e.g.: xattr -cr augment-flmbiciuyuwaomgdvhulunibwrms

Clean>Build>Run.

There is also a free app on Mac Appstore called "CleanDetritus" which will do removal of these.


This problem came to me yesterday.

(What's wrong) I updated image resources by manually replacing file in finder and I failed with this compilation error.

(What's right) Don't update image in this way. After that I dragged images to 'xcassets' in Xcode. No more error appear again.


The problem is in the derived data, You should clean the derived data and then clean the project and build. Please check this link.


My problem is every change I make in the code and execute again the error reappears. Then I find a solution to execute the command automatically every compilation/execution of code.

Thanks to @rich-able I discovered "Run Script". Then I put the command "xattr -cr ." in the field.

XCODE 솔루션


The simplest fix may be if you are using git. Try:

$ git stash
$ git stash pop

Git does not store file metadata, the above will strip it all away.


My problem was that I used cordova to build the app around 1 year ago, but it wasn't compatible with the new version of xcode, so I simply used cordova build ios and it worked again.


One of the best solution is Go to terminal type this

xattr -cr "Full path of your project"

To find full path of your right click on Xcode project->get info -> copy path and replace with . Then type below command

xattr -cr "Full path of your project"

Clean and build done.


If the xattr commands doesn't the trick this may be due to an XCode 9 bug: let's try to remove and re-add the resource folder (it was a .xcassets in my case) containing the affected files from Xcode. (you should understand which are the affected files previous through the xattr -lr command)


Open terminal and just run this command.

xattr -cr "path to .app file"


I'm also facing the same issue, got fixed by just restarting my Macbook.


I found that if I add color tag on the folder under DerivedData, it will give the above error when debug on device.

Remove the color Tag fix this error for me.

여기에 이미지 설명을 입력하십시오


You can remove the derived data Xcode -> Preferences

And click on the arrow below Derived Data, and empty the folder Derived Data

참고 : https://stackoverflow.com/questions/39652867/code-sign-error-in-macos-high-sierra-xcode-resource-fork-finder-information

반응형