Ionic build android command showing error


#1

i am working on Ionic Project with a platform add android. my project were running fine but now when i issue this command

ionic build android

it is showing me this error,

BUILD FAILED
C:\Program Files (x86)\Android\android-studio\sdk\tools\ant\build.xml:653: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-studio\sdk\tools\ant\build.xml:698: null returned: 1

Total time: 5 seconds

F:\Repo\eyd\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,F:\Repo\eyd\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: F:\Repo\eyd\platforms\android\cordova\build.bat: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\shahzad\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

i don’t know that what suddenly happened !
also the error is showing when i issue this command in cmd

ionic emulate android

#2

This just started happening to me, as well. It was working previously. Did you find a solution?


#3

if you added any wrong file on wrong place in res folder of android then you will receive this error. i were added wrong file in my res folder thats why i were getting this error. so you need to check where you added wrong file


#4

I checked and I haven’t added any other files to the res folder. Thanks for the tip though! I’ll keep trying to figure it out.


#5

My issue was with the config.xml file. I used Phonegap Build previously and I was using gap:density for the android icon and splash screens. Changing this to just “density” fixed the above errors.