ios - React Native 应用程序中的 PhaseScriptExecution 错误
问题描述
创建项目后运行 react-native run-ios 时遇到此错误
错误 -
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening BoltAssignment.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace BoltAssignment.xcworkspace -configuration Debug -scheme BoltAssignment -destination id=3E598855-6D4F-4F36-BEE1-8663A1F71787
nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"
Run `unset PREFIX` to unset it.
nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"
Run `unset PREFIX` to unset it.
Command PhaseScriptExecution failed with a nonzero exit code
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-Glog' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-PeerTalk' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'libwebp' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'YogaKit' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the BoltAssignment editor. (in target 'BoltAssignment' from project 'BoltAssignment')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-DoubleConversion' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')
warning: no rule to process file '/Users/harsh_nagalla/dev/BoltAssignment/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/harsh_nagalla/dev/BoltAssignment/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/harsh_nagalla/dev/BoltAssignment/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'RNFastImage' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'SDWebImageWebPCoder' from project 'Pods')
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/harsh_nagalla/Library/Developer/Xcode/DerivedData/BoltAssignment-cxeqsscopunscndrzxcrfnugkasb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-1F0D93C9412E4439D9C46216EB143B15.sh
(1 failure)
随后的步骤-
- 纱线安装
- 启动地铁服务器
- cd ios -> pod 安装
- npx react-native run-ios
对本机反应很新,所以我完全不知道为什么会这样。如果有人可以提供帮助,将不胜感激。
如果您遇到同样的问题并且仍然像我一样一无所知,那么请分享并投票,以便尽可能多地接触到。
解决方案
我想出了一个解决方案,如果您正在使用,请nvm
确保您没有另一个全局安装的 Node/npm 版本。
如果您不确定是否有全局版本,请转到您的 bash_profile/zshrc 并注释三个nvm
初始化行 ( export NVM_DIR="$HOME/.nvm" [...]
),然后打开一个新终端并执行node --version
,如果它仍然找到某些内容,则表示您有一个全局版本版本,你可以找到它的路径which node
。
就我而言,我使用的是 Homebrew,并且我有一个全局版本的 Node,我什至不知道yarn
它来自公式,我在运行brew uses --installed node
. 我继续使用 卸载了 yarn brew uninstall --force yarn
,它自动卸载了它的 node/npm 依赖项,然后取消注释nvm
初始化行,然后我yarn
使用 nvm 的 npm with重新安装npm i -g yarn
,现在一切正常。
推荐阅读
- java - NumberFormate 异常
- javascript - 将参数从 URL 添加到元素并滚动到元素
- python - 对 post 请求使用异步、多处理或多线程是否好?
- pointers - 给定两个变量,在计算机的大脑(内存)中找到它们的距离(以字节为单位)
- wpf - 将变量绑定到 Powershell 中的组合框和文本框
- reactjs - 如何优化大型 lang.json 文件以减小包大小
- javascript - React.js - 如何在不创建输入空间(段落空间)的情况下点击输入?
- python - 单击时移除 QPushButton 周围的方格边框
- html - 使用 HTML 选择下拉菜单,有没有办法让一些文本作为选项,但相应的文本显示为选中?
- javascript - 将数组拆分为均匀分布的数组