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

Steps to transplant the new kernel to the Linux system

1. Download the ubuntu16.04 image and the corresp...

Summary of some common configurations and techniques of Nginx

Preface This article lists several common, practi...

mysql5.7 installation and configuration tutorial under Centos7.3

This article shares the MySQL 5.7 installation an...

Tutorial on building svn server with docker

SVN is the abbreviation of subversion, an open so...

Why does MySQL paging become slower and slower when using limit?

Table of contents 1. Test experiment 2. Performan...

Some thoughts and experience sharing on web page (website) design and production

First, before posting! Thanks again to I Want to S...

If I change a property randomly in Vue data, will the view be updated?

Interviewer: Have you read the source code of Vue...

Mobile terminal adaptation makes px automatically converted to rem

Install postcss-pxtorem first: npm install postcs...

Analysis of the Nesting Rules of XHTML Tags

In the XHTML language, we all know that the ul ta...

Implementation example of Vue+Element+Springboot image upload

Recently, I happened to be in touch with the vue+...

Linux touch command usage examples

Detailed explanation of linux touch command: 1. C...

Detailed explanation of MySql view trigger stored procedure

view: When a temporary table is used repeatedly, ...

Introduction to using MySQL commands to create, delete, and query indexes

MySQL database tables can create, view, rebuild a...

HTML code to add quantity badge to message button

HTML code: <a onclick="goMessage();"...