早期 JsError:尝试使用新架构构建 Android 应用程序时出现 Turbo ModuleRegistry.getEnforcing (...)

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

当应用程序成功构建时,我看到此错误 早期 JsError:Turbo Module Registry.getEnforcing (...):找不到“PlatformConstants”。验证此名称的模块是否已在本机二进制文件中注册。无桥模式:正确。 Turbo 模块互操作性:正确。加载的模块: ("NativeModules":["TurboModules: "NotFound": ["NativePerformance ObserverCxx","Native PerformanceCxx","PlatformConstants")),

我的package.json

"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/preset-env": "^7.25.4",
"@babel/runtime": "^7.25.6",
"@react-native/eslint-config": "0.75.2",
"@react-native/metro-config": "0.75.2",
"@react-native/typescript-config": "0.75.2",
"@types/react": "^18.3.5",
"@types/react-native-background-timer": "^2.0.2",
"@types/react-native-dotenv": "^0.2.2",
"@types/react-test-renderer": "^18.3.0",
"babel-jest": "^29.7.0",
"babel-plugin-module-resolver": "^5.0.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^9.9.1",
"jest": "^29.7.0",
"prettier": "^3.3.3",
"react-native-dotenv": "^3.4.11",
"react-native-flipper-performance-plugin": "^0.4.0",
"react-test-renderer": "18.3.1",
"typescript": "5.5.4"
},
"dependencies": {
"@expo/config": "^9.0.3",
"@expo/env": "^0.3.0",
"@hookform/resolvers": "^3.9.0",
"@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-community/checkbox": "^0.5.17",
"@react-native-community/hooks": "^3.0.0",
"@react-native/codegen": "0.75.2",
"@react-native/metro-config": "^0.75.2",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-three/fiber": "^8.17.6",
"@reduxjs/toolkit": "^2.2.7",
"@sentry/react-native": "^5.31.1",
"@shopify/react-native-skia": "^1.3.11",
"@types/lodash": "^4.17.7",
"@types/three": "^0.168.0",
"axios": "^1.7.7",
"base64-arraybuffer": "^1.0.2",
"dayjs": "^1.11.13",
"expo": "51.0.32",
"expo-asset": "^10.0.10",
"expo-av": "~14.0.7",
"expo-constants": "~16.0.2",
"expo-file-system": "~17.0.1",
"expo-font": "~12.0.10",
"expo-gl": "~14.0.2",
"expo-modules-core": "^1.12.24",
"expo-screen-orientation": "~7.0.5",
"expo-sqlite": "~14.0.6",
"immer": "^10.1.1",
"lodash": "^4.17.21",
"react": "18.3.1",
"react-hook-form": "^7.53.0",
"react-icomoon": "^2.5.7",
"react-native": "0.75.2",
"react-native-background-timer": "^2.4.1",
"react-native-ble-manager": "^11.5.5",
"react-native-confirmation-code-field": "^7.4.0",
"react-native-fs": "^2.20.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-handler": "~2.19.0",
"react-native-just-checkbox": "^2.0.15",
"react-native-logs": "^5.1.0",
"react-native-material-menu": "^2.0.0",
"react-native-radio-buttons-group": "^3.1.0",
"react-native-reanimated": "3.15.1",
"react-native-redash": "^18.1.3",
"react-native-safe-area-context": "^4.10.9",
"react-native-screens": "~3.34.0",
"react-native-svg": "^15.6.0",
"react-native-svg-transformer": "^1.5.0",
"react-native-system-setting": "^1.7.6",
"react-native-toast-notifications": "^3.4.0",
"react-native-ui-datepicker": "^2.0.3",
"react-native-walkthrough-tooltip": "^1.6.0",
"react-native-wifi-reborn": "^4.12.1",
"react-redux": "^9.1.2",
"rn-animated-ellipsis": "^2.1.3",
"three": "0.168.0",
"three-stdlib": "^2.32.2",
"victory-native": "^41.1.1",
"yup": "^1.4.0",
"zustand": "^4.5.5"

已尝试解决类似错误但其他缺少模块的解决方案。没有任何帮助

图片错误

react-native
1个回答
0
投票

两个可能的原因是:

  1. React Native 的内部错误:目前存在与此错误相关的问题。当前版本 0.76.5 上出现这种情况。这是不久前开发新功能时引入的自动链接错误。
  2. 第二个是您安装的依赖项是否被破坏。当我为 Android 构建一个纯 C++ Turbo 模块时,我的场景出现了,并且忘记了或者或多或少不知道我要将它链接到我的 CmakeLists.txt 中的 libboost_atomic.so。我从我开发的桌面应用程序中移植了代码,并且不需要专门链接到该应用程序。然而,我链接到了其他东西,比如升压线程和文件系统。在此错误出现之前,Android Studio 的 logcat 中就出现了显示缺少 .so 文件的错误。模拟器屏幕大多数时候只告诉你一半的事实。因此,请尝试探测您的依赖项列表以查看是否有错误。还要检查您的 logcat 输出。
© www.soinside.com 2019 - 2024. All rights reserved.