Not able to setup React native project on windows

戏子无情 提交于 2020-05-17 06:34:29

问题


Hi I have followed the official documentation for setting up the React native project on windows. I have added the ANDROID_HOME variable as system variable at location

"C:\Users\AKSHAY\AppData\Local\Android\Sdk"

In the second step I was supposed to add Environment variable at

"C:\Android\tools\bin\platform-tools"

but there is no tools folder in Android instead I found platform-tools under SDK below is the location

"C:\Users\AKSHAY\AppData\Local\Android\Sdk\platform-tools"

Now when I am running

npx react-native run android

I am getting the below attached error

Here is the SDK folder Please help.


回答1:


setup an android emulator first with avd




回答2:


if your RN >=.62

You can run npx react-native doctor inside your project folder

else

run npx @react-native-community/cli doctor inside your project folder

This command checks your environment and displays a report of the status of react native installation. Check the output carefully for other software you might need to install.




回答3:


You can install android studio then add ANDROID_HOME to your ENV Variable and point to your SDK.

Follow this link: https://web.archive.org/web/20180210044548/http://spring.io/guides/gs/android/




回答4:


The path you are looking for is located at : C:\Users\"yourUser"\AppData\Local\Android\Sdk\platform-tools



来源:https://stackoverflow.com/questions/60996289/not-able-to-setup-react-native-project-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!