我已经开发了一个项目近5个月了,在升级当前的expo sdk后,我遇到了一个错误 - “配置项目':react-native-screens'时出现问题”。运行 npx expo 时运行:android
我已经尝试了所有解决方案,并通过删除节点模块和 package.lock.json 并运行 npm install 然后运行 npx expo prebuild --clean 提供,但它不起作用。我还构建了另一个应用程序。
type here
我尝试在不添加任何其他内容的情况下运行它,但它产生了同样的问题,这可能是 sdk 错误,因为我没有更改我的应用程序中的任何内容,只是升级,现在我无法构建
这是我的package.json
{
"name": "mtotosharp",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.2",
"@react-native-google-signin/google-signin": "^12.2.1",
"@react-navigation/native": "^6.0.2",
"expo": "~51.0.28",
"expo-constants": "~16.0.2",
"expo-font": "~12.0.9",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.23",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-web-browser": "~13.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.5",
"react-native-gesture-handler": "~2.16.1",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.3",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
},
"private": true
}
请将react-native-screens更新为3.32.0,它对我有用。
"react-native-screens": "^3.32.0"