在 MacOS 10.13.1 中导出 ipa 或上传到 App Store 时 Xcode 9.0.1 崩溃。
升级到 Xcode 9.1 (9B55) 后,导出时显示如下错误。
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.
看来 xattr 已损坏,在终端中运行 xattr 时,提示以下错误。
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
如何修复它或重新安装 xattr?