Android React Native Development Environment setup --- Under windows, android --- windows

Source: Internet
Author: User
Tags blank page

Android React Native Development Environment setup --- Under windows, android --- windows

Environment Construction

Environment building can refer to the RN official website, can also refer to the Chinese version: http://reactnative.cn/docs/0.45/getting-started.html

If you want to see the installation process of the original version, you can refer to the official address. This article is only my personal practice and is limited to the Windows platform.

Address: https://facebook.github.io/react-native/docs/getting-started.html

 

1. Download Chocolatey

Download from the official website.

2. Node, python2, jdk8

Choco install nodejs. install

Choco install python2

Choco install jdk8

If you have installed JDK 7 or the android development environment.

But, you still have to follow the above command to install JDK 8. I am not sure if JDK 7 can replace JDK 8, But the official requirements for JDK 8, so do it.

3. The React Native CLI

Npm install-g react-native-cli

4. android Development Environment

As an android developer, these environments have already been installed. You only need to pay attention to sdk 23 or above.

5. ANDROID_HOME

Set the sdk address bin path to android-home.

Now the basic environment is OK. Let's start the first project.

6. a new project

React-native init AwesomeProject

7. Use a real machine for debugging

The simulator can also be debugged. For details, refer to the official website. As android Developers, there should be many mobile phones, so real machines are the first choice. Usb driver, etc.

8. run android react native

Cd AwesomeProject

React-native run-android

9. Security Filtering

According to the official website process, everythingisok, but, you can see a blank page or a red warning page.

 

In this case, shake your phone and devsetting.

Here, we should first clarify that RN, that is, H5, is to be deployed to the server.

So. If the server is not deployed, the message is red.

Devsetting, find the debug server host or port..., enter the local address: 8081, and you will see the following picture:

Success!

 

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.