tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

新项目执行pod install报错 …

xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance

➜  ios git:(main) ✗ pod install
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
Auto-linking React Native modules for target `DuoleGameHelper`: RNCAsyncStorage, RNGestureHandler, RNScreens, and react-native-safe-area-context
Framework build type is static library
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
[Codegen] Found rncore
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
[!] Failed to load 'glog' podspec:
[!] Invalid `glog.podspec` file: undefined method `[]' for nil:NilClass.

# from /Users/sunyg/DuoleGameHelper/node_modules/react-native/third-party-podspecs/glog.podspec:38
# -------------------------------------------
# match = xcode_path.match(/Xcode (\d+)\.(\d+)/)
> major_version = match[1].to_i
# minor_version = match[2].to_i
# -------------------------------------------
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
➜  DuoleGameHelper git:(main) ✗ cd ios && pod install
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
Auto-linking React Native modules for target `DuoleGameHelper`: RNCAsyncStorage, RNGestureHandler, RNScreens, and react-native-safe-area-context
Framework build type is static library
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
[Codegen] Found rncore
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[Hermes] Using release tarball from URL: https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.73.1/react-native-artifacts-0.73.1-hermes-ios-debug.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16.2M 100 16.2M 0 0 749k 0 0:00:22 0:00:22 --:--:-- 726k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.3M 100 12.3M 0 0 741k 0 0:00:17 0:00:17 --:--:-- 770k
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.73.1)
Installing FBReactNativeSpec (0.73.1)
Installing Flipper (0.201.0)
Installing Flipper-Boost-iOSX (1.76.0.1.11)
Installing Flipper-DoubleConversion (3.2.0.1)
Installing Flipper-Fmt (7.1.7)
Installing Flipper-Folly (2.6.10)
Installing Flipper-Glog (0.5.0.5)
Installing Flipper-PeerTalk (0.0.4)
Installing FlipperKit (0.201.0)
Installing OpenSSL-Universal (1.1.1100)
Installing RCT-Folly (2022.05.16.00)
Installing RCTRequired (0.73.1)
Installing RCTTypeSafety (0.73.1)
Installing RNCAsyncStorage (1.21.0)
Installing RNGestureHandler (2.14.1)
Installing RNScreens (3.29.0)
Installing React (0.73.1)
Installing React-Codegen (0.73.1)
Installing React-Core (0.73.1)
Installing React-CoreModules (0.73.1)
Installing React-Fabric (0.73.1)
Installing React-FabricImage (0.73.1)
Installing React-ImageManager (0.73.1)
Installing React-Mapbuffer (0.73.1)
Installing React-NativeModulesApple (0.73.1)
Installing React-RCTActionSheet (0.73.1)
Installing React-RCTAnimation (0.73.1)
Installing React-RCTAppDelegate (0.73.1)
Installing React-RCTBlob (0.73.1)
Installing React-RCTFabric (0.73.1)
Installing React-RCTImage (0.73.1)
Installing React-RCTLinking (0.73.1)
Installing React-RCTNetwork (0.73.1)
Installing React-RCTSettings (0.73.1)
Installing React-RCTText (0.73.1)
Installing React-RCTVibration (0.73.1)
Installing React-callinvoker (0.73.1)
Installing React-cxxreact (0.73.1)
Installing React-debug (0.73.1)
Installing React-graphics (0.73.1)
Installing React-hermes (0.73.1)
Installing React-jserrorhandler (0.73.1)
Installing React-jsi (0.73.1)
Installing React-jsiexecutor (0.73.1)
Installing React-jsinspector (0.73.1)
Installing React-logger (0.73.1)
Installing React-nativeconfig (0.73.1)
Installing React-perflogger (0.73.1)
Installing React-rendererdebug (0.73.1)
Installing React-rncore (0.73.1)
Installing React-runtimeexecutor (0.73.1)
Installing React-runtimescheduler (0.73.1)
Installing React-utils (0.73.1)
Installing ReactCommon (0.73.1)
Installing SocketRocket (0.6.1)
Installing Yoga (1.14.0)
Installing boost (1.83.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
Installing hermes-engine (0.73.1)
Installing libevent (2.1.12)
Installing react-native-safe-area-context (4.8.2)
Generating Pods project
Setting USE_HERMES build settings
Setting REACT_NATIVE build settings
Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /Users/sunyg/DuoleGameHelper/ios/DuoleGameHelper.xcodeproj
Pod install took 690 [s] to run
Integrating client project
Pod installation complete! There are 77 dependencies from the Podfile and 65 total pods installed.

[!] hermes-engine has added 1 script phase. Please inspect before executing a build. See `https://guides.cocoapods.org/syntax/podspec.html#script_phases` for more information.

[!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via `pod repo remove master`. To suppress this warning please add `warn_for_unused_master_specs_repo => false` to your Podfile.

tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

https://www.cctv3.net/static/20240124/ios-xcode-select-error.html

作者

江北饮马、江南折花

发布于

2024-01-24

更新于

2024-02-03

许可协议

评论