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

Introduction to user management under Linux system

Table of contents 1. The significance of users an...

Detailed explanation of computed properties in Vue

Table of contents Interpolation Expressions metho...

Installation tutorial of mysql 8.0.11 compressed version under win10

This article shares the installation tutorial of ...

Detailed tutorial on installing nacos in docker and configuring the database

Environment Preparation Docker environment MySQL ...

HTML background color gradient effect achieved through CSS style

Effect screenshots: Implementation code: Copy code...

Basic security settings steps for centos7 server

Turn off ping scanning, although it doesn't h...

MySQL foreign key (FOREIGN KEY) usage case detailed explanation

Introduction: The disadvantages of storing all da...

Full analysis of MySQL INT type

Preface: Integer is one of the most commonly used...

JavaScript to achieve product query function

This article example shares the specific code of ...

In-depth explanation of the global status of WeChat applet

Preface In WeChat applet, you can use globalData ...

JavaScript implements simple scroll window

This article example shares the specific code of ...

translate(-50%,-50%) in CSS achieves horizontal and vertical centering effect

translate(-50%,-50%) attributes: Move it up and l...