My ionic build task isn't working properly.
First, I follow these commands:
ionic start secondApp blank
cd secondApp
ionic platform add android
ionic build android
When ant build prepare to package the project resources, the task throws this error:
-package-resources:
[aapt] Creating full resource package...
BUILD FAILED
E:\usr\bin\android-sdk\tools\ant\build.xml:932: The following error occurred while executing this line:
E:\usr\bin\android-sdk\tools\ant\build.xml:950: null returned: -1073741819
Total time: 32 seconds
E:\dev\projects\ionic\secondApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,E:\dev\projects\ionic\secondApp\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: E:\dev\projects\ionic\secondApp\platforms\android\cordova\build.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Ricardo\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)
I already try to clean my project and delete .cordova and .ionic but the problem still persist.
What's wrong?
ANT_HOME, ANDROID_HOME, JAVA_HOME are OK
I encountered the same error. See the following for more information:
https://code.google.com/p/android/issues/detail?id=77629
Downgrading to the Android SDK Build-Tools 20 should allow the build to complete again. That resolved the problem for me.
I just retested it with the example ionic project, and it works with SDK Build Tools 21.0.2.
Failing aapt has been fixed for windows/x64 with this version.
So actually upgrading might be an option for you as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With