ionic5 is packaged into android studio to run

Need to download the android studio editor
android studio download address

Download java JDK
java JDK environment configuration

Configure the environment
in the computer directory 控制面板\系统和安全\系统-advanced system settings-environment variables
系统变量added

变量名:JAVA_HOME
变量值:C:\Program Files\Java\jdk1.8.0_31

The variable value is the path
Insert picture description here
where you installed the JDK, 系统变量/Pathadd it later

;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

Start cmdinput java, output a push configuration information have configured a success

Package local project

ionic build

My project is packaged and reported this error

Class extends value undefined is not a constructor or null

This problem is mainly the problem of installing dependencies, reinstalling dependencies

npm install

If you still report an error, use the yarninstallation

yarn install

Create androidproject

ionic cap add android

Automatically open android studio will download related dependencies

ionic cap open android

Connect your phone to USB, open it, 设置\开发人员选项\USB调试
Insert picture description here
select it Run on Multiple Devicesand it will automatically download the app to your phone

Guess you like

Origin blog.csdn.net/AK852369/article/details/115261644