[英]How to fix DVTToolchain: Failed to load toolchain using Xcode command line tools?
Anytime I run any command with xcrun
or xcodebuild
in the terminal it always outputs: xcrun
我在终端中使用xcrun
或xcodebuild
运行任何命令时,它总是输出:
VTToolchain: Failed to load toolchain: : Error Domain=DVTToolchainErrorDomain Code=4 "alleged toolchain directory doesn't contain ToolchainInfo.plist or Info.plist" UserInfo={NSFilePath=/Library/Developer/Toolchains/swift-latest.xctoolchain, NSLocalizedDescription=alleged toolchain directory doesn't contain ToolchainInfo.plist or Info.plist}
VTToolchain: 加载工具链失败: : Error Domain=DVTToolchainErrorDomain Code=4 “所谓的工具链目录不包含 ToolchainInfo.plist 或 Info.plist” UserInfo={NSFilePath=/Library/Developer/Toolchains/swift-latest.xctoolchain, NSLocalizedDescription = 所谓的工具链目录不包含 ToolchainInfo.plist 或 Info.plist}
I have opened the /Toolchains/switft-latest.xctoolchain and it contains Toolchain.Info.plist, so I am confused on how to fix this error.我打开了 /Toolchains/switft-latest.xctoolchain 并且它包含 Toolchain.Info.plist,所以我对如何修复这个错误感到困惑。 I have tried reinstalling Xcode and reinstalling Xcode command tools
我已经尝试重新安装 Xcode 并重新安装 Xcode 命令工具
These are my SDK paths:这些是我的 SDK 路径:
xcode-select -p
/Applications/Xcode.app/Contents/Developer
xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
I fixed the issue by removing the link to the latest toolchain in Library/Developer/Toolchains
.我通过删除
Library/Developer/Toolchains
最新工具链的链接解决了这个问题。
$ cd /Library/Developer/Toolchains/
$ ls -l
$ -rw-r--r--@ 1 user admin 1268976 Sep 3 04:43 swift-latest.xctoolchain
$ rm swift-latest.xctoolchain
I ran xcodebuild
right after and I had no error.之后我立即运行了
xcodebuild
并且没有错误。 The issue was from previously downloading a new toolchain and Xcode didn't remove it correctly when I uninstalled it.问题出在之前下载了一个新的工具链,而 Xcode 在我卸载它时没有正确删除它。 I had help from this github issue .
我从这个github 问题中得到了帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.