Quickly build a React Native Android development environment in Windows

Source: Internet
Author: User

Quickly build a React Native Android development environment in Windows
Build a JAVA Development Environment

Download JDK 1.8 or later versions based on the operating system's x86 or x64 bit,

Java version for local installation: jdk-8u45-windows-x64.exe




Configure JAVA environment variables
JAVA_HOME = C: \ Program Files \ Java \ jdk1.8.0 _ 45 CLASSPATH = .; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar; path added; % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;


Install Android Studio

Android Studio version: androidstudio1.5.0.0.1454148047.exe


Add environment variable configuration for Android SDK

 

ANDROID_HOME = D: \ Android \ sdkpath added; % ANDROID_HOME % \ tools; % ANDROID_HOME % \ platform-tools;

 

 

Install Git Version Control

Git version for local installation: Git-1.9.5-preview.exe

Install Virtual Machine

 

Virtual Machine version during local installation: genymotion-2.6.0-vbox

 

This software requires you to register an account on the official website before you can download it. Official website address: www.genymotion.com/

 

Install React-native-cli

npm install -g react-native-cli


Initialize a project


react-native init reactNative


Start the project

react-native start

 

Run the preceding command to open the following connection:

Http: // localhost: 8081/index. android. bundle? Platform = android

On the page:

This page indicates that the android project has not been compiled successfully.

You need to delete the files in this path under the project (MyProject: myProject \ node_modules \ react-native \ node_modules \ react-transform-hmr \ node_modules \ react-proxy \ node_modules \ react-deep-force-update \. babelrc

For example:

 

Close the cmd window and run react-native start again. Press enter.

The following figure shows the connection address page.

 

If you execute react-native start, an error may be reported:

 

Solution:
Modify this file F: \ reactNative \ MyReact \ node_modules \ react-native \ packager \ react-packager \ src \ DependencyResolver \ FileWatcher \ index. js

Set the original
Const MAX_WAIT_TIME = 120000;
Change

Const MAX_WAIT_TIME = 120000000;

 

 

Run android app
react-native run-android
Running may take some time. Be patient

 

 

Android debugging

Currently, chrome cannot be automatically enabled for debugging in Windows, so you can manually open chrome and access the following url: http: // localhost: 8081/debugger-ui.

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.