【问题标题】:MacOS 11.5.2 clang error : Cannot find SDKMacOS 11.5.2 clang 错误:找不到 SDK
【发布时间】:2021-10-22 08:32:35
【问题描述】:

昨晚我将系统更新到 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 听起来是正确的位置,但它所引用的 Mobile 目录超出了我的范围。

我的疑惑是那个Mobile框架?我不知道。 如果我允许安装 Clang,它会立即返回提供此错误。如果我什至重新启动终端甚至计算机,它仍然会出现此错误。

我该如何解决这个问题,所以找到了 clang,不再要求我安装它并提供这个讨厌的错误。

【问题讨论】:

    标签: xcode macos clang


    【解决方案1】:

    升级后删除 Xcode 和所有 /Library/Developer/ 解决了我的问题,只需要重新安装 SDK。

    【讨论】:

      猜你喜欢
      • 2014-01-02
      • 1970-01-01
      • 1970-01-01
      • 2019-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-12
      • 1970-01-01
      相关资源
      最近更新 更多