Xcode 9.1 export failed

Xcode 9.0.1 crash when export ipa or upload to App Store.

After upgraded to Xcode 9.1, it shows error as below when export.

Stripping extended attributes failed.
"/usr/bin/xattr -crs /var/folders/mm/h01jykrs7gv9w7jjb0yt609w0000gp/T/XcodeDistPipeline.Uay/Root/Payload/GitSmartHome.app" exited with a non-zero status. The /usr/bin/xattr tool may be damaged.


It seems xattr was damaged, and when run xattr in Terminal, it prompts below error.

xattr
Traceback (most recent call last):
  File "/usr/bin/xattr-2.7", line 7, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.macosx-10.13-intel/egg/pkg_resources/__init__.py", line 3019, in <module>
  File "build/bdist.macosx-10.13-intel/egg/pkg_resources/__init__.py", line 3003, in _call_aside
  File "build/bdist.macosx-10.13-intel/egg/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
  File "build/bdist.macosx-10.13-intel/egg/pkg_resources/__init__.py", line 655, in _build_master
  File "build/bdist.macosx-10.13-intel/egg/pkg_resources/__init__.py", line 963, in require
  File "build/bdist.macosx-10.13-intel/egg/pkg_resources/__init__.py", line 849, in resolve
pkg_resources.DistributionNotFound: The 'xattr==0.6.4' distribution was not found and is required by the application


Pls kindly advise how to fix it or re-install xattr?

Thanks.

Replies

now xattr can execute without error, however, Xcode prompts

2017-11-01 14:02:24 +0000 
2017-11-01 14:02:24 +0000 Running /usr/bin/xattr '-crs' '/var/folders/mm/h01jykrs7gv9w7jjb0yt609w0000gp/T/XcodeDistPipeline.U1x/Root/Payload/GitSmartHome.app' 
2017-11-01 14:02:24 +0000 option -c not recognized 
usage: xattr [-lz] file [file ...] 
xattr -p [-lz] attr_name file [file ...] 
xattr -w [-z] attr_name attr_value file [file ...] 
xattr -d attr_name file [file ...] 
The first form lists the names of all xattrs on the given file(s). 
The second form (-p) prints the value of the xattr attr_name. 
The third form (-w) sets the value of the xattr attr_name to attr_value. 
The fourth form (-d) deletes the xattr attr_name. 
options: -h: print this help -l: print long format (attr_name: attr_value) -z: compress or decompress (if compressed) attribute value in zip format 
2017-11-01 14:02:24 +0000 
2017-11-01 14:02:24 +0000 
2017-11-01 14:02:24 +0000 /usr/bin/xattr exited with 64



Pls kindly advise how to fix it, thanks.

May found the solution of it.



My situation: in the terminal and XCode it's not able to run /usr/bin/xattr. Then I found a report on stackoverflow saying wheather xattr-0.6.4 supports well OSX 10.x up. Then I tried the command:



`$defaults write com.apple.versioner.python Version 2.6`



, which persistently change the system python version to 2.6. Then the executable file will automatically select /usr/bin/xattr-2.6. Then everything works well.



You can select the python back to 2.7 every time with:



`unset VERSIONER_PYTHON_VERSION`