Environment construction
Environmental construction can refer to the RN official website, also can refer to the Chinese version: http://reactnative.cn/docs/0.45/getting-started.html
If you want to see the original installation process, you can look at the official address, this article is only my personal practice, and is limited to the window platform.
Official address: https://facebook.github.io/react-native/docs/getting-started.html
1. Download chocolatey
To the official website to download, generally no problem.
2.node,python2,jdk8
Choco Install Nodejs. Install
Choco Install Python2
Choco Install Jdk8
If you already have Jdk7 installed, or you already have an Android development environment.
But, you still have to follow the above command to install JDK8. I can't confirm if Jdk7 can replace Jdk8, but the official request Jdk8, so do it.
3.The React Native CLI
NPM install- g react-native-cli
4.android Development Environment
As an Android developer, these environments themselves have already been installed, just pay attention to the need for more than 23 SDK.
5.Android_home
Set the path of the SDK address bin to Android-home
Now that the basic environment is OK, we start the first project
6.A New Project
React-native init awesomeproject
7. Debugging with a real machine
Simulators can also be debugged, specific crossing nets, as Android developers, should have a lot of phones, so the real machine is the first choice. USB drive, etc., has been done.
8.run android react native
CD Awesomeproject
React-native Run-android
9. Safe filtering
According to the process of the official website, everythingisok,but, you see a blank page, or a red warning page.
This time shake a mobile phone, devsetting.
The first thing to understand here is that RN, which is simply the H5 run, H5 needs to be deployed to the server
To run, so, without deploying the server, it will be reported red.
devsetting, locate debug server host or Port ... , enter the local address: 8081, you can see the following screen:
Done!
Android React Native Development environment built---windows