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

Expo React Native运行Android项目时PlatformConstants TurboModule找不到的错误求助

Expo React Native运行Android项目时PlatformConstants TurboModule找不到的错误求助

各位好,我在执行npx expo run:android启动我的Expo React Native项目时,碰到了一个棘手的错误,具体报错信息如下:

ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

我的项目依赖配置如下(package.json中的相关部分):

"dependencies": {
  "@expo/vector-icons": "^14.1.0",
  "@react-native-picker/picker": "2.11.0",
  "@react-navigation/bottom-tabs": "^7.3.10",
  "@react-navigation/elements": "^2.3.8",
  "@react-navigation/native": "^7.1.6",
  "appwrite": "^17.0.2",
  "axios": "^1.9.0",
  "expo": "~53.0.7",
  "expo-blur": "~14.1.4",
  "expo-constants": "~17.1.5",
  "expo-dev-client": "^5.1.8",
  "expo-font": "~13.3.1",
  "expo-haptics": "~14.1.4",
  "expo-image": "~2.1.6",
  "expo-image-picker": "~16.1.4",
  "expo-linear-gradient": "~14.1.4",
  "expo-linking": "~7.1.4",
  "expo-router": "~5.0.5",
  "expo-splash-screen": "~0.30.8",
  "expo-status-bar": "~2.2.3",
  "expo-symbols": "~0.4.4",
  "expo-system-ui": "~5.0.7",
  "expo-web-browser": "~14.1.6",
  "nativewind": "^4.1.23",
  "react": "19.0.0",
  "react-dom": "19.0.0",
  "react-native": "0.79.2",
  "react-native-appwrite": "^0.7.3",
  "react-native-gesture-handler": "~2.24.0",
  "react-native-reanimated": "^3.17.5",
  "react-native-safe-area-context": "^5.4.0",
  "react-native-screens": "~4.10.0",
  "react-native-web": "~0.20.0",
  "react-native-webview": "13.13.5",
  "expo-location": "~18.1.4"
},
"devDependencies": {
  "@babel/core": "^7.25.2",
  "@types/react": "~19.0.10",
  "autoprefixer": "^10.4.21",
  "eslint": "^9.25.0",
  "eslint-config-expo": "~9.2.0",
  "postcss": "^8.5.3",
  "tailwindcss": "^3.4.17",
  "typescript": "~5.8.3"
}

我已经尝试了各种可能的解决办法——清理npm缓存、重新安装所有依赖、删除android目录后重建原生项目这些操作都试过了,但问题依然存在。而且我翻遍了各种技术论坛和文档,也没找到能针对性解决这个问题的方案。

有没有朋友遇到过类似的情况,或者能给我一些排查的方向?非常感谢!

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.08 12:13:08