我使用的是M2 MacBook Air芯片和xCode。在模拟器中执行应用程序时,我收到以下React Native错误:
以下生成命令失败:PhaseScriptExecution [CP-User]\ Generate\ Specs /User.../FBReactNativeSpec.build/Script-46EB2E110.sh(在项目“Pods”的目标“FBReactNativeSpec”中)(1次失败)
即使我启动一个全新的React Native项目并尝试在iOS上执行,这个问题仍然存在。是什么导致了错误,如何修复?
谢谢你
更新:下面是我对react-native info的配置设置:
info正在获取系统和库信息...
System:
OS: macOS 14.1
CPU: (8) arm64 Apple M2
Memory: 498.81 MB / 24.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.8.1 - /usr/local/bin/npm
Watchman: 2023.09.25.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.13.0 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode: 15.0/15A240d - /usr/bin/xcodebuild
Languages:
Java: 19.0.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.4 => 0.66.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
完成程序:
1.产品目的地选择显示Rosetta
1.链接器标志添加-ld64
1条答案
按热度按时间mnemlml81#
将此代码添加到post_install中的Pod文件中,然后再次安装Pod
例如我的podfile