Я попытался React-Native init
новый проект, но он сказал мне, что нет CocoaPods и хочет, чтобы я установил, как blow:
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 раньше, однако я набрал Да, но это не удалось:
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)
Кто-нибудь может мне помочь?