You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

集成react-native-reanimated后React Navigation崩溃问题求助

React Native集成react-native-reanimated后导航触发EXC_BAD_ACCESS崩溃

我在React Native项目中加入react-native-reanimated库后,导航系统出现严重问题:

  • 集成前导航完全正常,可通过定义的类型正常跳转
  • 集成后,点击导航栈头部返回按钮或切换底部标签导航器时,应用会突然崩溃,无任何错误提示
  • 用Flipper调试发现错误标记为EXC_BAD_ACCESS,这是内存访问相关问题
  • 仅在添加react-native-reanimated包后出现该问题,移除包则一切恢复正常

项目的package.json配置如下:

{
  "name": "DocvivoMobil",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/checkbox": "^0.5.16",
    "@react-native-community/datetimepicker": "^7.4.2",
    "@react-navigation/bottom-tabs": "^6.5.8",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "babel-plugin-module-resolver": "^5.0.0",
    "formik": "^2.4.3",
    "moment": "^2.29.4",
    "react": "18.2.0",
    "react-native": "0.72.4",
    "react-native-dropdown-select-list": "^2.0.5",
    "react-native-gesture-handler": "^2.12.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.8.2",
    "react-native-phone-number-input": "^2.1.0",
    "react-native-safe-area-context": "^4.7.1",
    "react-native-screens": "^3.24.0",
    "react-native-svg": "^13.13.0",
    "react-native-vector-icons": "^10.0.0",
    "styled-components": "^6.0.7",
    "yup": "^1.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/eslint-config": "^0.72.2",
    "@react-native/metro-config": "^0.72.11",
    "@tsconfig/react-native": "^3.0.2",
    "@types/jest": "^29.5.4",
    "@types/react": "^18.2.21",
    "@types/react-native": "^0.72.2",
    "@types/react-native-vector-icons": "^6.4.14",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.76.8",
    "prettier": "^2.4.1",
    "react-test-renderer": "18.2.0",
    "typescript": "^5.2.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

我已经尝试了以下解决方法,但都没有效果:

  • 更新所有包到最新版本
  • 确认react-native-reanimated已正确链接
  • 验证其他模块的兼容性,排除冲突可能
  • 检查react-native-reanimated与React Native版本的兼容性
  • 调整package.json中包的顺序

有没有人遇到过类似的集成问题?求帮忙给点建议,谢谢!

内容的提问来源于stack exchange,提问作者ahmetarslan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 16:04:54