How to build my app into APK

Hi, I am trying to build my app into APK file. However, there are some issues I can’t solve it.

This is my ionic info

cli packages: (C:\Users\USERNAME\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.7
    Cordova Platforms  : android 6.3.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.1.2
    npm  : 5.0.3
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

When I tried to run: ionic cordova build android

It prompt error of

Error: ./node_modules/firebase/app/shared_promise.js
............

So I tried "npm install promise-polyfill --save-exact"
it successfully added package and I re-run “ionic cordova build android” and it build success

How can I go from here

Thankyou.

Are you trying to create apk using android studio or cmd

If u r tring using cmd then some issues may raise
But once try Android studio for creating APK.

I can’t see the problem since you have said “I re-run “ionic cordova build android” and it build success”… which means your APK is already there?
but I can answer the error you have

Environment Variables:

ANDROID_HOME : not set

which means you need to set the environment variable ANDROID_HOME

environment variable ANDROID_HOME, this is for what purposes?

I am using visual studio code to do all actions, thus, I uses the integrate cmd to run and build too