React Native environment installation process

React Native environment installation process

react-native installation process

1.npx react-native init AwesomeProject reports an error

insert image description here

Run cd ./demo/ios && pod install to solve the problem

2. Install JDK

(1) brew install adoptopenjdk/openjdk/adoptopenjdk8
Run react-native doctor under the running project and report an error
✖ JDK

  • Version found: 1.8.0_191
  • Version supported: >= 8

insert image description here

This error does not affect the environment. Note that the official version 1.8 is also called version 8, which is not recognized by the doctor.

3. Create a configuration file ~/.zshrc

(1). You can use the echo $0 command to check the shell you are using.
(2) Create a configuration file ~/.zshrc
(If it is bash, it is ~/.bash_profile)
Enter touch .zshrc in the command line to check whether the creation is successful. Use open $HOME/.zshrc to open the folder, indicating that the creation is successful. (3) Open the terminal and enter: /usr/libexec/java_home -V

insert image description here

Check the Java installation path and configure the Java environment variables (not necessarily required, but I configured it)

WARNING: export JAVA_HOME export CLASSPATH

![Insert image description here](https://img-blog.csdnimg.cn/20210516220225712.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTg1ODI5MQ==,size_16,color_FFFFFF,t_70

Run Java - version, it shows

insert image description here

The installation is successful

2. When installing Android SDK, an error message appears saying that the version does not match. Click Show Package Details to install the corresponding version.

insert image description here

Configure ANDROID_HOME environment variable

(1) Check the installation path of the SDK in Android studio

insert image description here

(2) Configure the ANDROID_HOME environment variable in .zshrc
export ANDROID_HOME= HOME / L ibrary / A ndroid / sdk export PATH= HOME/Library/Android/sdk export PATH= HOME/Library/Android/sdk export PATH= PATH: ANDROIDHOME / emulator export PATH = ANDROIDH​OME/emulator export PATH= PATH: ANDROIDHOME / tools export PATH= ANDROIDH​OME/tools export PATH=PATH: ANDROIDHOME / tools / bin export PATH = ANDROIDH​OME/tools/bin export PATH=PATH:$ANDROID_HOME/platform-tools

insert image description here

Environment installation successful

4. Run npm run android

The app cannot be installed in reality, and an error is reported in port 8081. After switching to a foreign data source, the installation is normal.

This is the end of this article about react native environment installation. For more relevant react native environment installation content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Solve the problem of react-native soft keyboard popping up and blocking the input box
  • Use Win10+Android+Yoshi Android emulator to build ReactNative development environment
  • React Native code example based on FlatList pull-down refresh pull-up load
  • Encapsulate a React Native multi-level linkage by yourself
  • React Native example of how to get geographic location
  • React Native text carousel implementation example

<<:  Detailed tutorial on installation and configuration of nginx under Centos7

>>:  Navicat multiple ways to modify MySQL database password

Recommend

Summary of situations where MySQL indexes will not be used

Types of Indexes in MySQL Generally, they can be ...

MySQL uses frm files and ibd files to restore table data

Table of contents Introduction to frm files and i...

React concurrent function experience (front-end concurrent mode)

React is an open-source JavaScript library used b...

Detailed explanation of filters and directives in Vue

Table of contents vue custom directive Global Dir...

Install redis and MySQL on CentOS

1|0MySQL (MariaDB) 1|11. Description MariaDB data...

Implementation of installing Docker in win10 environment

1. Enter the Docker official website First, go to...

MySQL complete collapse query regular matching detailed explanation

Overview In the previous chapter, we learned abou...

Axios cancel request and avoid duplicate requests

Table of contents origin status quo Cancel reques...

Simply understand the writing and execution order of MySQL statements

There is a big difference between the writing ord...

Vue-cli creates a project and analyzes the project structure

Table of contents 1. Enter a directory and create...

How does MySQL ensure master-slave consistency?

Table of contents The basic principle of MySQL ma...

WeChat applet development practical skills: data transmission and storage

Combining the various problems I encountered in m...

Nginx proxy axios request and precautions

Preface I recently wrote a small demo. Because I ...