按照react native官方中文网页的教程,在win10上安装了react native环境,包括安装了android studio,创建了项目;
在命令行进入项目目录,使用yarn react-native doctor 发现1个error如下:
✖ Android SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: 33.0.0
键盘按e键修复,提示:
√ Android SDK configured. You might need to restart your PC for all changes to take effect.
按照提示重启电脑,再进入重新检测但问题依旧。
根据网上的解答进入android studio的sdk manager中安装Android SDK Command-line Tools(latest),软件提示安装成功完成:
Installing Android SDK Command-line Tools (latest) in D:\AndroidSdk\cmdline-tools\latest
"Install Android SDK Command-line Tools (latest) (revision: 11.0)" complete.
"Install Android SDK Command-line Tools (latest) (revision: 11.0)" finished.
但再次进入android studio的sdk manager中发现Android SDK Command-line Tools(latest)选项仍未勾选,为Not Installed状态!
查看安装目录下已有安装文件,各种环境变量也均已按教程和网上各种解答设置了,但不知道为什么react-native doctor和android studio都未能检测到!