老师,是不是创建一个RN项目,一定要给cocoapods设置代理源呢
来源:2-2 开发环境搭建指导-Mac平台【持续更新】

歌安_bmwBM0
2024-11-17
我创建项目时,生成的不是.xcworkspace 文件,而是.xcodeproj,所以不能成功打开模拟器,问题应该是在cocoapods 上,该怎么解决呢?代码如下,谢谢!
✖ Installing CocoaPods dependencies with New Architecture (this may take a few minutes)
error % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
46 23.3M 46 10.7M 0 0 22499 0 0:18:05 0:08:21 0:09:44 33052
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16.3M 100 16.3M 0 0 942k 0 0:00:17 0:00:17 --:–:-- 1400k
[!] [Codegen] warn: using experimental new codegen integration
error Installing Cocoapods failed. This doesn’t affect project initialization and you can safely proceed. However, you will need to install Cocoapods manually when running iOS, follow additional steps in “Run instructions for iOS” section.
Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/environment-setup?os=macos&platform=ios&guide=native and follow the React Native CLI QuickStart guide for macOS and iOS.
info 💡 To enable automatic CocoaPods installation when building for iOS you can create react-native.config.js with automaticPodsInstallation field.
For more details, see https://github.com/react-native-community/cli/blob/main/docs/projects.md#projectiosautomaticpodsinstallation
Run instructions for Android:
• Have an Android emulator running (quickest way to get started), or a device connected.
• cd “/Users/huafusong/FACProject” && npx react-native run-android
Run instructions for iOS:
• cd “/Users/huafusong/FACProject”
• npx react-native run-ios
- or -
• Open FACProject/ios/FACProject.xcodeproj in Xcode or run "xed -b ios"
• Hit the Run button
Run instructions for macOS:
• See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.
1回答
-
是的,从报错信息上看是项目依赖的cocoapods每个下载完成,开下代理或者设置下镜像多试几次看看。022024-11-21
相似问题