react-native build process environment

First-time RN development process

First, I use a window to develop, can only develop Android applications;
Second, you must install the dependencies have: Node, React Native command-line tool, Python2 and Studio JDK and Android;
(I downloaded the Java JDK have not been downloaded well, then let me java sent a friend to me;
1.Python2 own search based on the process to download on the line.
after 2.java JDK download and install the required configuration environment variables, search the internet with how environmental variables, is very simple, I installed here C: \ Program Files \ Java \ jdk1.8.0_181;
Note Node version must be greater than 10, Python must be version 2.x (not supported 3.x), and must JDK version 1.8 (currently does not support 1.9 and later ). after installing Node npm recommendations provided behind the mirror to accelerate the process.)


Third, the global installation react-native scaffolding
npm install -g yarn react-native-installation or use yarn, yarn npm the alternative tool facebook,

Config Registry https://registry.npm.taobao.org --global the SET 1.yarn
2.yarn the SET disturl https://npm.taobao.org/dist --global config);
Fourth, the Android development environment
1. Download android Studio, (Chinese network has download links to domestic users may not open, download their own country, http://www.android-studio.org/ ), in accordance with their own procedures step by step download;
2.sdk default download in c: \ users \ your user name \ AppData \ Local \ Android \ Sdk , but can not have Chinese names, or will be error, (I changed Chinese, change the environment variable, a registry, also requires the administrator to log in) I downloaded from the internet folder on the disc d, configure the environment variables;
1, create an environment variable name ANDROID_HOME, the current variable value SDK installation directory; e.g. SDK installed in d: \ androidSDK in the environment variables


2, the% ANDROID_HOME% \ platform-tools;% ANDROID_HOME% \ tools environment variable added to the Path.

 

 


Fifth, create a project
1, the init AwesomeProject Native REACT-
2, with android Studio is opened, this will download a gradle, pay attention to its version number (mine is 5.4.1, in build.gradle file version 3.4.0 is required ), you can go to search to see the version number of the ratio gradle online;


3. Use the Android emulator, create a Create Virtual Device ..;
VI, compile and run React Native application
1, in the project folder open cmd, run npm start, run a service link simulator;

2, the android Studio click Run, select Run, to go along with the flow, will eventually compile, compile the first time requires a lot of time; if there is an error, you need to see what error you look at the process in question; if not successfully compile error, but simulator does not change, it once again points to the right of the triangle symbol, and run it again; it should correctly;


3, indicating the success of the event you run this page; a lot of error may occur during the process need to be patient to see the problem solved;

 

Guess you like

Origin www.cnblogs.com/ggqggq/p/11095770.html