[英]Error Failed to install CocoaPods dependencies for ios project. React Native
I have a macbook pro m1 and I am getting the above error when trying npx react-native init.我有一个 macbook pro m1,在尝试 npx react-native init 时出现上述错误。 I have followed the react native documentation for environment set up.我已按照环境设置的本机文档进行操作。 I tried to install pod via brew, however, still the same error.我尝试通过 brew 安装 pod,但是,仍然是同样的错误。 What is the issue?问题是什么? I see a lot of people having the same issue, but there is no clear explanation or solution for it?我看到很多人有同样的问题,但没有明确的解释或解决方案? Please help请帮忙
✔ Processing template ✖ Installing CocoaPods dependencies (this may take a few minutes) ✖ Installing CocoaPods dependencies (this may take a few minutes) error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. ✔ Processing template ✖ Installing CocoaPods dependencies (this may take a few minutes) ✖ Installing CocoaPods dependencies (this may take a few minutes) error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. Please try again manually: "cd./test/ios && pod install".请手动重试:“cd./test/ios && pod install”。 CocoaPods documentation: https://cocoapods.org/ CocoaPods 文档: https://cocoapods.org/
[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. [注意] 您可能在 Ruby 解释器或扩展库中遇到了错误。 Bug reports are welcome.欢迎提交错误报告。 For details: https://www.ruby-lang.org/bugreport.html详情: https://www.ruby-lang.org/bugreport.html
[IMPORTANT] Don't forget to include the Crash Report log file under DiagnosticReports directory in bug reports. [重要] 不要忘记在错误报告中包含 DiagnosticReports 目录下的崩溃报告日志文件。
when I tried to run ios:当我尝试运行 ios 时:
BUILD FAILED **构建失败**
The following build commands failed: CompileC /Users/patrickbelan/Library/Developer/Xcode/DerivedData/test-gqoaknolitrwejedppjzybscmama/Build/Intermediates.noindex/test.build/Debug-iphonesimulator/test.build/Objects-normal/arm64/main.o /Users/patrickbelan/Desktop/react/test/ios/test/main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'test' from project 'test') CompileC /Users/patrickbelan/Library/Developer/Xcode/DerivedData/test-gqoaknolitrwejedppjzybscmama/Build/Intermediates.noindex/test.build/Debug-iphonesimulator/test.build/Objects-normal/arm64/AppDelegate.o /Users/patrickbelan/Desktop/react/test/ios/test/AppDelegate.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'test' from project 'test') (2 failures)以下构建命令失败:CompileC /Users/patrickbelan/Library/Developer/Xcode/DerivedData/test-gqoaknolitrwejedppjzybscmama/Build/Intermediates.noindex/test.build/Debug-iphonesimulator/test.build/Objects-normal/arm64/main。 o /Users/patrickbelan/Desktop/react/test/ios/test/main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'test' from project 'test') CompileC /Users /patrickbelan/Library/Developer/Xcode/DerivedData/test-gqoaknolitrwejedppjzybscmama/Build/Intermediates.noindex/test.build/Debug-iphonesimulator/test.build/Objects-normal/arm64/AppDelegate.o /Users/patrickbelan/Desktop/react /test/ios/test/AppDelegate.m 正常 arm64 objective-c com.apple.compilers.llvm.Z2C5517DB7BC397F9B14AE357A7CE52 故障FFZ.1_0.test' (来自目标编译器)
enter image description here在此处输入图像描述
how about trying to further ensure with Xcode that there is a valid command-line tool chosen.如何尝试使用 Xcode 进一步确保选择了有效的命令行工具。 , go to Xcode Preferences » Location and selected Xcode version from the Command Line Tools select list if its blank. , go to Xcode Preferences » Location and selected Xcode version from the Command Line Tools select list if its blank.
And then run cd./yourAppName/ios && pod install inside that app folder然后在该应用程序文件夹中运行 cd./yourAppName/ios && pod install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.