-按照中文官方文档构建项目,中文文档说的是33版本的sdk,使用react-native init构建时自动下载了34版本,英文文档使用的也是34版本,(compileSdkVersion = 34)但是可以正常运行。
-在使用导航组件时,react-navigation的bottom组件需要下载依赖react-native-screens组件,下载后就无法运行了。
-运行命令时npx react-native doctor显示如下。
✓ Adb - Required to verify if the android device is attached correctly
✓ JDK - Required to compile Java code
✖ Android Studio - Required for building and installing your app on Android
✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
✓ Gradlew - Build tool required for Android builds
✖ Android SDK - Required for building and installing your app on Android
Versions found: N/A
Version supported: 34.0.0
-移除react-native-screens后构建成功,但渲染报错【TypeError: Cannot read property 'ResourceSavingView' of undefined】,发现bottom-tabs需要它的依赖,
问题的具体描述
-按照中文官方文档构建项目,中文文档说的是33版本的sdk,使用react-native init构建时自动下载了34版本,英文文档使用的也是34版本,(compileSdkVersion = 34)但是可以正常运行。 -在使用导航组件时,react-navigation的bottom组件需要下载依赖react-native-screens组件,下载后就无法运行了。 -运行命令时npx react-native doctor显示如下。 ✓ Adb - Required to verify if the android device is attached correctly ✓ JDK - Required to compile Java code ✖ Android Studio - Required for building and installing your app on Android ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation ✓ Gradlew - Build tool required for Android builds ✖ Android SDK - Required for building and installing your app on Android
完整的环境/版本信息
请在命令行的项目目录中运行
npx react-native info
命令,并将其输出结果粘贴到这里。如果问题涉及到第三方包/库/模块,请也将 package.json 的内容粘贴到这里。 { "name": "AwesomeProject", "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": { "@cometchat/chat-sdk-react-native": "^4.0.8", "@cometchat/chat-uikit-react-native": "^4.3.11", "@react-native-async-storage/async-storage": "^1.23.1", "@react-native-clipboard/clipboard": "^1.14.1", "@react-native-community/datetimepicker": "^8.1.0", "@react-native-community/netinfo": "^11.3.2", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@react-navigation/stack": "^6.3.29", "react": "18.2.0", "react-native": "0.74.1", "react-native-background-timer": "^2.4.1", "react-native-callstats": "^3.73.22", "react-native-gesture-handler": "^2.16.2", "react-native-safe-area-context": "^4.10.4", "react-native-screens": "^3.31.1", "react-native-webrtc": "^124.0.0", "react-query": "^3.39.3", "recyclerlistview": "^4.2.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.74.83", "@react-native/eslint-config": "0.74.83", "@react-native/metro-config": "0.74.83", "@react-native/typescript-config": "0.74.83", "@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-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" }, "packageManager": "yarn@3.6.4" }
预期结果
现在无法使用react-navigation的bottom-tabs,而底部标签导航是非常需要的。