更新到 SDK 51 时 Expo Go 崩溃

问题描述 投票:0回答:1

我刚刚更新了我的项目的 SDK,因为 expo GO IOS 应用程序自动更新到 SDK51。 我的项目在 SDK 50 上运行良好。 但更新后,出现错误: 不变违规:“main”尚未注册。如果出现以下情况,就会发生这种情况:

  • Metro(本地开发服务器)从错误的文件夹运行。检查Metro是否正在运行,在当前项目中停止并重新启动它。
  • 模块由于错误而无法加载,并且
    AppRegistry.registerComponent
    未被调用。,js引擎:hermes

这是我的package.json:

{
  "name": "client",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "lint": "eslint . --ext .js,.jsx ./",
    "lint-fix": "eslint . --ext .js,.jsx ./ --fix"
  },
  "dependencies": {
    "@babel/eslint-parser": "^7.23.10",
    "@gorhom/bottom-sheet": "^4.6.1",
    "@react-native-community/checkbox": "^0.5.17",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/drawer": "^6.6.15",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@react-navigation/stack": "^6.3.20",
    "@reduxjs/toolkit": "^2.2.1",
    "antd": "^5.12.2",
    "deprecated-react-native-prop-types": "^5.0.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-jsx-a11y": "^6.8.0",
    "eslint-plugin-react": "^7.34.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-native": "^4.1.0",
    "expo": "^51.0.0",
    "expo-build-properties": "~0.12.1",
    "expo-camera": "~15.0.6",
    "expo-image-picker": "~15.0.4",
    "expo-linear-gradient": "~13.0.2",
    "expo-media-library": "~16.0.3",
    "expo-status-bar": "~1.12.1",
    "firebase": "^10.11.0",
    "moment": "^2.29.4",
    "moti": "^0.28.1",
    "nativewind": "^2.0.11",
    "radio-buttons-react-native": "^1.0.4",
    "react": "18.2.0",
    "react-native": "0.74.1",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-pager-view": "6.3.0",
    "react-native-popover-view": "^5.1.8",
    "react-native-popup-menu": "^0.16.1",
    "react-native-reanimated": "~3.10.1",
    "react-native-reanimated-carousel": "^3.5.1",
    "react-native-redash": "^18.1.2",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-star-rating": "^1.1.0",
    "react-native-svg": "15.2.0",
    "react-native-swiper": "^1.6.0",
    "react-native-switch": "^1.5.1",
    "react-native-tab-view": "^3.5.2",
    "react-native-vector-icons": "^10.0.3",
    "react-redux": "^9.1.0",
    "redux": "^5.0.1",
    "tailwindcss": "3.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@types/react": "~18.2.79",
    "@types/react-native": "^0.73.0",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "prettier": "^3.2.5",
    "typescript": "~5.3.3"
  },
  "private": true
}

请帮助我。谢谢大家。

我尝试更新 React Native 版本和其他一些有关堆栈溢出的解决方案,但没有成功。

react-native mobile expo sdk
1个回答
0
投票

遇到了同样的问题,这个帮助了我: https://github.com/expo/expo/issues/28618

© www.soinside.com 2019 - 2024. All rights reserved.