Facebook released React Native for Android on September 15, 2015, extending the WEB and native platform's JavaScript development technology to Google's popular mobile platform--android.
Recently idle to want to build environment to play a bit. Now to summarize the problems encountered in the hope for the novice helpful.
First of all, I was lucky enough to find the geek. The Chinese wiki of translation is then set up as described below.
PS: Document details please visit: (http://wiki.jikexueyuan.com/project/react-native/)
The first time because of the MAC system is not familiar with how to make a bad feeling, this command is very difficult to use AH headache. Can be packaged and installed at the first build but run into a lot of problems
Problem One: Running white screen on a real machine
Workaround:
My main development machine is Android 4.4. According to the official documentation, you need to press the menu key or shake your phone and set the IP address of the dev server in the development menu. I've tried it before and I can't open this menu without any action. It suddenly occurred to me, was the system blocked? I went to find the system permission settings, found as follows:
Question 2:unable to download JS bundle. Did you forget to start the development server or connect your device?
Real machine and simulator have such a problem, online asked a lot of people also Dabigatran asked a lot of people finally locked up for the server did not open.
Solution: Compared to the wiki tutorial to go over again the first time the installation of various software is more chaotic the second time has the first experience and then re-set the previous missed steps to go again and react-native Run-andriod. The simulator successfully runs through.
Question 3: Run through the simulation cry and then look back to see if the real machine or not with the problem of the second almost only unable to download JS bundle. This sentence indicates that the server is up.
Solution: Originally I was a computer with a mobile phone connected to a WiFi network and then use a computer to connect the cable and then create a WiFi phone and then connect the computer created WiFi and then select the Dev settings->debug server host for device in the menu, Fill in the IP address of your development computer. Problem solving. Now the simulator phone can be debugged and run perfectly.
React Native Environment Construction Strategy