错误:[Reanimated] 无法创建工作集反应本机错误

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

在react-nativer-reanimated版本3.15和react-native cli版本0.75中出现错误

babel.config.js
如果有不正确的地方请归档

module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: [
    ["react-native-auto-route/plugin", { appDirectory: "src" }],
    "nativewind/babel",
    'react-native-reanimated/plugin'
  ],
};

package.json

{
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.6.0",
    "@fortawesome/free-solid-svg-icons": "^6.6.0",
    "@fortawesome/react-native-fontawesome": "^0.3.2",
    "@react-native-community/blur": "^4.4.0",
    "nativewind": "^2.0.11",
    "react": "18.3.1",
    "react-native": "0.75.2",
    "react-native-blurhash": "^2.0.3",
    "react-native-gesture-handler": "^2.18.1",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-loader-kit": "^2.0.8",
    "react-native-paper": "^5.12.5",
    "react-native-reanimated": "^3.15.0",
    "react-native-safe-area-context": "^4.10.9",
    "react-native-screens": "^3.34.0",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^15.6.0",
    "react-native-track-player": "^4.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.25.4",
    "@react-native/babel-preset": "0.75.2",
    "@react-native/eslint-config": "0.75.2",
    "@react-native/metro-config": "0.75.2",
    "@react-native/typescript-config": "0.75.2",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-native-auto-route": "^0.3.3",
    "react-test-renderer": "18.3.1",
    "tailwindcss": "^3.3.2",
    "typescript": "5.0.4"
  }
}

我研究了错误并浏览了文档应用了所有解决方案

  1. 将其保留在
    babel.config.js
  2. 位置应该是最后一个
react-native react-native-reanimated react-native-cli
1个回答
0
投票

尝试在

import 'react-native-gesture-handler';
 之前添加 
import './gesture-handler.native';

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