Android React Native Development Environment setup --- Under windows, android --- windows
Environment Construction
Environment building can refer to the RN official website, can also refer to the Chinese version: http://reactnative.cn/docs/0.45/getting-started.html
If you want to see the installation process of the original version, you can refer to the official address. This article is only my personal practice and is limited to the Windows platform.
Address: https://facebook.github.io/react-native/docs/getting-started.html
1. Download Chocolatey
Download from the official website.
2. Node, python2, jdk8
Choco install nodejs. install
Choco install python2
Choco install jdk8
If you have installed JDK 7 or the android development environment.
But, you still have to follow the above command to install JDK 8. I am not sure if JDK 7 can replace JDK 8, But the official requirements for JDK 8, so do it.
3. The React Native CLI
Npm install-g react-native-cli
4. android Development Environment
As an android developer, these environments have already been installed. You only need to pay attention to sdk 23 or above.
5. ANDROID_HOME
Set the sdk address bin path to android-home.
Now the basic environment is OK. Let's start the first project.
6. a new project
React-native init AwesomeProject
7. Use a real machine for debugging
The simulator can also be debugged. For details, refer to the official website. As android Developers, there should be many mobile phones, so real machines are the first choice. Usb driver, etc.
8. run android react native
Cd AwesomeProject
React-native run-android
9. Security Filtering
According to the official website process, everythingisok, but, you can see a blank page or a red warning page.
In this case, shake your phone and devsetting.
Here, we should first clarify that RN, that is, H5, is to be deployed to the server.
So. If the server is not deployed, the message is red.
Devsetting, find the debug server host or port..., enter the local address: 8081, and you will see the following picture:
Success!