Android build not working with latest sdk


#1

The latest Adnroid SDK has been downloaded and installed but ionic build android command gets error:

E:\HTML5\exm>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" E:\HTML5\exm\hooks\afte
r_prepare\010_add_platform_class.js E:\HTML5\exm
add to body class: platform-android
Running command: cmd "/s /c "E:\HTML5\exm\platforms\android\cordova\build.b
at""
[Error: Please install Android target: "android-22".

Hint: Open the SDK manager by running: H:\Softwares\Java\android-sdk\tools\android.BAT
You will require:
1. "SDK Platform" for android-22
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
ERROR building one of the platforms: Error: cmd: Command failed with exit code 2

You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 2
    at ChildProcess.whenDone (C:\Users\Mirodil\AppData\Roaming\npm\node_modules\
cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)