desenvolvimento@desenvolvimento:~/Documentos/Alura/Ionic2/aluraCar$ ionic platform
The platform command has been renamed. To find out more, run:
ionic cordova platform --help
desenvolvimento@desenvolvimento:~/Documentos/Alura/Ionic2/aluraCar$ ionic cordova platform
cordova platform ls
✔ Running command - done!
Installed platforms:
android 6.2.3
ios 4.1.1
Available platforms:
blackberry10 ~3.8.0 (deprecated)
browser ~4.1.0
ubuntu ~4.3.4 (deprecated)
webos ~3.7.0
desenvolvimento@desenvolvimento:~/Documentos/Alura/Ionic2/aluraCar$ sudo ionic cordova platform rm android
cordova platform remove android --save
✔ Running command - done!
Removing platform android from config.xml file...
Removing android from cordova.platforms array in package.json
desenvolvimento@desenvolvimento:~/Documentos/Alura/Ionic2/aluraCar$ sudo ionic cordova platform add android
cordova platform add android --save
✔ Running command - done!
Using cordova-fetch for cordova-android@~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.ionicframework.aluracar550260
Name: aluraCar
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android@6.2.3
Installing "cordova-plugin-console" for android
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-splashscreen" for android
Installing "cordova-plugin-statusbar" for android
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do not need this plugin since the whitelist will be built in.
Installing "ionic-plugin-keyboard" for android
--save flag or autosave detected
Saving android@~6.2.3 into config.xml file ...
✔ Copying default image resources into ./resources/android - done!
desenvolvimento@desenvolvimento:~/Documentos/Alura/Ionic2/aluraCar$ sudo ionic cordova build android
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser
[12:32:58] build dev started ...
[12:32:58] clean started ...
[12:32:58] clean finished in 2 ms
[12:32:58] copy started ...
[12:32:58] transpile started ...
[12:33:00] transpile finished in 1.53 s
[12:33:00] preprocess started ...
[12:33:00] deeplinks started ...
[12:33:00] deeplinks finished in 32 ms
[12:33:00] preprocess finished in 33 ms
[12:33:00] webpack started ...
[12:33:00] copy finished in 2.14 s
[12:33:06] webpack finished in 6.14 s
[12:33:06] sass started ...
[12:33:06] sass finished in 682 ms
[12:33:06] postprocess started ...
[12:33:06] postprocess finished in 4 ms
[12:33:06] lint started ...
[12:33:06] build dev finished in 8.42 s
cordova build android
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
desenvolvimento@desenvolvimento:~/Documentos/Alura/Ionic2/aluraCar$ (node:9434) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed