“ git:错误:无法确定'/Applications/…/iPhoneOS13.0.sdk'的真实路径(errno =没有这样的文件或目录)\ n

问题描述 投票:1回答:1

我试图React-Native init一个新项目,但它告诉我没有CocoaPods,要我安装,如打击:

info Installing required CocoaPods dependencies
? CocoaPods (https://cocoapods.org/) is not installed. It's necessary for iOS pr
oject to run correctly. Do you want to install it? Yes

好吧,我之前已经安装了Cocoapods,但是我输入了Yes,但是失败了:

Password:
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --version` ("git: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk' (errno=No such file or directory)\ngit: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk -find git 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)\ngit: error: unable to find utility \"git\", not a developer tool or in PATH\n") (RuntimeError)
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:130:in `verify_minimum_git_version!'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:49:in `run'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/bin/pod:55:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

(node:77073) UnhandledPromiseRejectionWarning: Error: Failed to update CocoaPods repositories for iOS project.
Please try again manually: "pod repo update".
CocoaPods documentation: https://cocoapods.org/
    at updatePods (/Users/easerliu/Projects/test1/app3/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/installPods.js:81:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:77073) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:77073) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

当我键入pod install pod repo update和其他Pod命令时,总是会收到这样的错误:

/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --version` ("git: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk' (errno=No such file or directory)\ngit: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk -find git 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)\ngit: error: unable to find utility \"git\", not a developer tool or in PATH\n") (RuntimeError)
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:130:in `verify_minimum_git_version!'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:49:in `run'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/bin/pod:55:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

我尝试重新安装Cocoapods

sudo gem install cocoapods
Password:
Successfully installed cocoapods-1.8.3
Parsing documentation for cocoapods-1.8.3
Done installing documentation for cocoapods after 3 seconds
1 gem installed

sudo xcodebuild -license但它不起作用。顺便说一句,我昨天更新了Xcode,不知道是不是原因

版本11.1(11A1027)

任何人都可以帮助我吗?

ios xcode git cocoapods
1个回答
0
投票

首先检查是否为restarting XCode helps,或检查XCode Preference Locations tab以确保您引用的是新的更新版本。

© www.soinside.com 2019 - 2024. All rights reserved.