When upgrading ionic I receive this error when trying to run “ionic build android”. I thought it was by setting ANDROID_HOME but my bash_profile this as ever. Not because it is not carrying out the project generation.
BUILD FAILED
Total time: 9.242 secs
/Users/lixsys/app_view/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/lixsys/app_view/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/lixsys/app_view/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/lixsys/app_view/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/lixsys/app_view/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
This error is to do with the permissions of your application, if you are building on windows, move the directory to C:\ and try compiling again or check for special characters on the route of your project, often directories with the structure C:\users\user_name\Documents have conflicts. it happens when you try to build using android studio as well.