Reference: http://www.lcode.org/react-native/
React Native Chinese web: http://reactnative.cn/docs/0.23/android-setup.html#content
1 , installation JDK (best default installation path try not to change)
Http://jingyan.baidu.com/article/a24b33cd59b58e19fe002bb9.html
Http://www.jb51.net/article/36811.htm (three environment variables are configured)
Java SE Development Kit 8u77 Windows x64187.31 MB Jdk-8u77-windows-x64.exe (64-bit) Pro test--must be installed to the disk root directory
2 , installation SDK
The quickest way to do this is to copy your colleague's installed SDK (If you download it, fix it. ) SDK Update Slow FQ problem: http://androiddevtools.cn/ )
command line Run adb Detection SDK Install successful no
3 , installation node. js
: https://nodejs.org/en/
The next step does not need to prepare environment variables click Install after
NODE-V command to test whether the Nodejs installation was successful
4 , installation git
: https://git-for-windows.github.io/
You need to configure the environment variable reference http://jingyan.baidu.com/album/9f7e7ec0b17cac6f2815548d.html?picindex=1
5. Install the react-native command-line tool react-native-cli
After the GIT configuration can clone react-native-cli, we recommend you to the REACT-NATIVE-CLI clone to a disk, do not directly clone in the C disk
1) in the command line, enter the directory where you wish to install RN
2) Enter Git clone https://github.com/facebook/react-native.git, wait for download
3) Enter the REACT-NATIVE-CLI directory under the React-native directory in the directory you just entered, and type NPM install-g
After installation, you can have the react-native command on the command line.
6. Create an RN Project
After entering the directory where you want to create the project, enter React-native init awesomeproject and wait for a period of time (slower)
Post-Success Directory structure
7. Run the package
Enter the project directory at the command line, input react-native start, wait for a period of time: after success
This time can be accessed with the browser http://localhost:8081/index.android.bundle?platform=android, if you can access to indicate that the server side is ready.
8. Install genymotion (Ignore-no tube)
Genymotion is a third-party simulator that is easier to set up and performs better than the official Google Simulator. However, it is free for individual users only. If you want to use Google Emulator, please look down.
- Download and install Genymotion.
- Open Genymotion. If you have not installed VirtualBox, it is possible that you will be prompted to install.
- Create a simulator and start.
Virtual machine VM VirtualBox can not boot, prompt such a mistake, how to solve?
You cannot open a new task for the virtual computer Custom Phone-4.1.1-api 16-768x1280.
Unable to load R3 module D:\New folder/vboxdd.dll (VBOXDD): getlasterror=1790 (Verr_unresolved_error).
Return code: E_FAIL (0x80004005)
Component: Console
Interface: Iconsole{8ab7c520-2442-4b66-8d74-4ff1e195d2b6}
http://zhidao.baidu.com/question/369440038457309444.html?fr=iks&word=%B2%BB%C4%DC%CE%AA%D0%E9%C4%E2%B5%E7% C4%d4+google+nexus+4+-+4.4.4+-+api+19+-+768x1280+%b4%f2%bf%aa%d2%bb%b8%f6%d0%c2%c8%ce%ce%f1.++unable+to+load+ r3+module+e%3a%5cvb%2fvboxdd.dll+%28vboxdd%29%3a+getlasterror%3d1790+%28verr_unresolved_error%29.++%b7%b5%bb%d 8+%b4%fa%c2%eb%3ae_fail+%280x80004005%29+%d7%e9%bc%fe%3aconsolewrap+%bd%e7%c3%e6%3aiconsole+% 7b872da645-4a9b-1727-bee&ie=gbk
9. Run the project
(Connect your phone with a data cable, open developer mode, and click Allow USB installation.) I MI5 phone, in running the project install apk times wrong, need to close: deprecated MIUI optimization, specifically refer to the article:
React-native study notes--first install APK to Xiaomi 5 error
)
The command line that just ran the package does not close, restart a new command line,
Go to project directory and enter React-native run-android
Wait for the run (if it is the first run, the Gradle will be downloaded first, the time is longer)
Occurs after a successful run
10. The first mobile phone must be an error
After tapping dev settings, click Debug Server Host & port for device to set IP and ports
Here IP is the IP of the computer, do not know can be entered in the command line ipconfig to query, port number fixed 8081
After setting up, go back to the blank page, shake the phone again, choose Reload JS, the program will run up, appear welcome to React native!
React-native study Notes-the most detailed Windows version ever installed react native environment configuration