Error android build error code 1

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)

Reviewing have everything properly configured and installed the latest version of the SDK, and the last api 22. -.- please help!

can you try to build with cordova build android

akso toy can remove android platform and add it with cordova platform add android

I tried did not work for me, I keep getting the same error. All this happened after updating ionic -.-

you can take new project and copy all files to it…

I have the same problem. Using the cordova build commands doesn’t change this.

I have also made a new project from scratch and copied all files over. Same problem.

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.

GRADLE permissions!

It works for me:

just go to '/home/your-user/.gradle/wrapper/dists/

delete everything inside of this

It will be replaced by android studio

on terminal run: ionic emulate android

Its all… :sunglasses:

1 Like

Excellent solution Tomcosta. It works as described. Thanks

1 Like