Could'nt take build ,fails with an exception

When i tried to taking build it fails with an exception.

ionic info

e:\CoolAp>ionic info

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

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.10.3
    npm  : 3.10.10
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

First of all you have to update your npm and global packages.

You also have to set your ANDROID_HOME.


To update npm

npm install npm@latest -g

To update global packages

npm update -g


Rightclick on My Computer -> Properties -> Advanced system settings -> Advanced -> Environment Variables…

grafik

New -> (use your android-sdk path!)

grafik


After that.

  1. Reboot your PC
  2. Remove node_modules from your app folder
  3. npm install (in your app folder)
  4. ionic cordova run android

Done! :bird:

Followed the steps you mentioned,but no luck


info

E:\CoolAp>ionic info

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

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v6.10.3
    npm               : 5.7.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\Ajith\AppData\Local\Android\Sdk

Misc:

    backend : pro