错误命令失败,退出代码为1,未找到react-native和Xcode库

yhived7q  于 2022-11-26  发布在  React
关注(0)|答案(1)|浏览(133)

当我从github,yarn install,cd ios && pod install,cd..,yarn ios克隆react原生项目时,我会收到以下错误。和/或当我运行react原生run-ios时,也会收到以下错误:

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.

此外,当我在Xcode中打开.xcworkspace时,出现错误:

library not found for BugsnagReactNative

package.json为:

{
  "name": "proj",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "build": "CI= npm run build",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@bugsnag/react-native": "^7.16.2",
    "@react-native-async-storage/async-storage": "^1.15.6",
    "@react-native-community/checkbox": "^0.5.8",
    "@react-native-community/datetimepicker": "^4.0.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-navigation/bottom-tabs": "^6.0.5",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/stack": "^6.0.7",
    "amazon-cognito-identity-js": "^5.1.0",
    "aws-amplify": "^4.2.4",
    "axios": "^0.21.1",
    "package": "^1.0.1",
    "prop-types": "^15.7.2",
    "react": "17.0.2",
    "react-native": "0.66.3",
    "react-native-carousel": "^0.12.0",
    "react-native-codegen": "^0.0.7",
    "react-native-collapsible": "^1.6.0",
    "react-native-date-picker": "^4.1.1",
    "react-native-dropdown-picker": "^5.1.23",
    "react-native-exit-app": "^1.1.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-mask-input": "^1.0.3",
    "react-native-modal-dropdown": "^1.0.1",
    "react-native-month-year-picker": "^1.8.0",
    "react-native-safe-area-context": "^3.3.0",
    "react-native-screens": "^3.13.1",
    "react-native-select-dropdown": "^1.1.0",
    "react-native-snap-carousel": "^3.9.1",
    "tcomb-form-native": "^0.6.20",
    "toggle-switch-react-native": "^3.2.0",
    "yarn": "^1.22.17"
  },
  "devDependencies": {
    "@babel/core": "^7.15.0",
    "@babel/runtime": "^7.15.3",
    "@bugsnag/source-maps": "^2.3.1",
    "@react-native-community/eslint-config": "^3.0.0",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "26.6.3",
    "eslint": "7.32.0",
    "jest": "^27.0.6",
    "metro-react-native-babel-preset": "^0.66.2",
    "react-test-renderer": "17.0.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

我尝试的以下解决方案不起作用。

  • Yarn添加全球@bugsnag/react-native-cli
  • 将rct-folly部署目标更改为9.0
  • 将“仅构建活动体系结构”设置为“是”
  • 点击并在xcode中安装ios 13.0模拟器
  • 删除构建设置中的搜索路径删除pod文件夹,并重新安装pod
  • 删除“其他链接器标志”列表中的所有行,但仅当$(inherited)位于顶部时
  • pod更新
  • 重新安装ruby/gem
  • 卸载并重新安装Cocoapods
  • rm -rf节点模块,Yarn缓存清理
  • 删除podfile.lock和pod,重新安装它们
  • sudo arch -x86_64 gem安装ffi,arch -x86_64 pod安装
  • 卸载并重新安装watchman
  • 检查节点版本、react本机版本和bugsnag版本
  • 注解掉package.json中的bugsnag依赖项
  • 多次全新安装
41zrol4v

41zrol4v1#

试试这个
npx @错误/React Native客户端初始化
并检查bugsnag文档,因为您需要在bugsnag上提供一个项目

相关问题