MacOS 11.5.2 clang error : Cannot find SDK



昨晚我更新了我的系统到11.5.2,但是发现clang不再工作了,特别是对于一个我需要从命令行编译的项目。

这是我接收到的输出

(base) kd@kd-MacBook-Pro ~ % clang --version
objc[3677]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20082bad8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1233e42b8). One of the two will be used. Which one is undefined.
objc[3677]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20082bb28) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1233e4308). One of the two will be used. Which one is undefined.
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" cannot be located.
clang: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find clang 2> /dev/null' failed with exit code 16384: (null) (errno=Invalid argument)
xcode-select: Failed to locate 'clang', requesting installation of command line developer tools.
(base) kd@kd-MacBook-Pro ~ % ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk 
Entitlements.plist  SDKSettings.json    SDKSettings.plist   System          usr
(base) kd@kd-MacBook-Pro ~ % 

正如你所看到的目录确实存在,新的是AMSupportURLConnectionDelegate和AMSupportURLSession已经弹出,/usr/lib听起来像正确的地方,但它引用的移动目录超出了我。

我的寻求怀疑是移动框架?我不确定。如果我允许Clang安装,它就会返回这个错误。如果我重新启动终端或计算机,它仍然有这个错误。

我如何修复这个问题,这样clang被发现,不再要求我安装它,并提供这个讨厌的错误。

在升级后删除Xcode和所有/Library/Developer/解决了这个问题,只需要重新安装sdk。

相关内容

最新更新