在 React Native 博览会中从 SDK 49 升级到 51 后,应用程序使用堆栈导航崩溃

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

我已将我的 React Native Expo 应用程序从 SDK 49 升级到 SDK 51。最初,一切似乎都工作正常。但是,当我尝试使用嵌套堆栈导航器进行导航时,应用程序崩溃了,但没有显示任何错误消息。

我尝试更新 package.json 并获取要显示的错误消息。软件包都是最新的,但不会显示任何消息。

这是我的package.json:

{
  "name": "friscohaar",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@emotion/react": "^11.11.1",
    "@emotion/styled": "^11.11.0",
    "@expo/vector-icons": "^14.0.0",
    "@mui/icons-material": "^5.15.6",
    "@mui/material": "^5.14.19",
    "@react-native-community/checkbox": "^0.5.17",
    "@react-native-community/datetimepicker": "^7.7.0",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/native-stack": "^6.9.17",
    "@react-navigation/stack": "^6.3.20",
    "axios": "^1.6.7",
    "expo": "^51.0.1",
    "expo-blur": "^13.0.2",
    "expo-checkbox": "~3.0.0",
    "expo-image-picker": "~15.0.4",
    "expo-linear-gradient": "~13.0.2",
    "expo-location": "~17.0.1",
    "expo-status-bar": "~1.12.1",
    "lodash": "^4.17.21",
    "moment": "^2.29.4",
    "react": "18.2.0",
    "react-native": "0.74.1",
    "react-native-animatable": "^1.4.0",
    "react-native-calendars": "^1.1304.1",
    "react-native-datepicker": "^1.7.2",
    "react-native-dotenv": "^3.4.10",
    "react-native-elements": "^3.4.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-modern-datepicker": "^1.0.0-beta.91",
    "react-native-paper": "^5.11.6",
    "react-native-safe-area-context": "^4.10.1",
    "react-native-screens": "~3.31.1",
    "react-native-size-matters": "^0.4.2",
    "react-native-status-bar-height": "^2.6.0",
    "typescript": "^5.1.3"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@types/react-native-modern-datepicker": "^1.0.5",
    "babel-plugin-inline-dotenv": "^1.7.0"
  },
  "private": true
}

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

谢谢发帖~

我在Expo Go自动更新到51后也遇到了同样的问题,导致应用程序在使用时崩溃

navigation.navigate

为了解决这个问题,我通过运行添加了

react-native-reanimated

yarn add react-native-reanimated

然后,我将其导入到

App.js
App.tsx

import 'react-native-reanimated'

这似乎是 Expo 的一个已知问题,但无论如何,Expo 51 的更新已推送给所有 Expo Go 用户。讨论可以在https://github.com/expo/expo/issues/28618

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