Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1 #205

Closed
Harapuia opened this issue Jun 12, 2015 · 14 comments

Comments

@Harapuia
Copy link

Hi! It seems google updated the android SDK to 24.3.2, and now our application no longer builds properly. Nothing has been changed besides that the SDK has updated, so i've included the log:

BUILD FAILED
/home/link0/dev/android/sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/link0/dev/android/sdk-linux/tools/ant/build.xml:655: Execute failed: java.io.IOException: Cannot run program "/home/link0/code/python-for-android/dist/skelly/${aidl}": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at com.android.ant.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102)
at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131)
at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 48 more

Total time: 4 seconds
7/site-packages/numpy/compat/init.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/numpy/compat/_inspect.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/numpy/compat/setupscons.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/numpy/compat/py3k.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/numpy/compat/setup.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/jnius/init.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/jnius/jnius.so
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/jnius/reflect.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/billing.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/init.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/_android.so
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/runnable.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/mixer.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/_android_sound.so
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/broadcast.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/activity.pyo
assets/private.mp3: /home/link0/code/python-for-android/dist/skelly/private/lib/python2.7/site-packages/android/_android_billing.so
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/nfc.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/main.kv
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/filewidget.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/globalvars.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/notes
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/androidcamera.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/homescreen.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/camerahelper.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/androidwidgetholder.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/cam2.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/cam.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/main.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/sitecustomize.pyo
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_tap_and_play_white_48dp.png
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_edit_white_48dp.png
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_menu_search_mtrl_alpha.png
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_delete_white_48dp.png
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_videocam_off_white_48dp.png
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_videocam_white_48dp.png
assets/private.mp3: /home/link0/code/tribler/android/.buildozer/android/app/img/ic_more_vert_white_48dp.png
Traceback (most recent call last):
File "build.py", line 507, in
make_package(args)
File "build.py", line 356, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

Command failed: /usr/bin/python build.py --name SkeletonApp --version 1.0 --package org.test.skelly --private /home/link0/code/tribler/android/.buildozer/android/app --sdk 22 --minsdk 16 --permission CAMERA --permission INTERNET --permission NFC --permission READ_EXTERNAL_STORAGE --permission RECORD_AUDIO --permission VIBRATE --permission WRITE_EXTERNAL_STORAGE --orientation sensor --window --intent-filters /home/link0/code/tribler/android/filters.xml debug

Buildozer failed to execute the last command

The error might be hidden in the log above this error

Please read the full log, and search for it before

raising an issue with buildozer itself.

In case of a bug report, please add a full log with log_level = 2

Any idea what's wrong and how to fix it?

@denys-duchier
Copy link
Contributor

here is a PR that may fix it #206

the problem for me was that build-tools were not being installed. my patch to buildozer solved that issue.

@Harapuia
Copy link
Author

Doesn't seem to do it, i'm afraid.

I've installed it, deleted the .buildozer folder and ran buildozer android update, but the error persists.
What i also find interesting is that i can't locate the folder for api 24, just the api 22 which i've installed in a custom location (and buildozer refers to)

Maybe i'm still missing a step?

@Harapuia
Copy link
Author

It seems to have been the latest version of ANT: forcibly replacing it with an older version of the folder solved the issue and seems to be a workaround until a proper fix is made

@prometx
Copy link

prometx commented Jun 16, 2015

Hi, I currently seem to have ant 1.9.4 on Ubuntu. Could you please confirm the version you reverted from? Ant website says 1.9.5 is the most current. Thanks very much for the input.

Best,

@prometx
Copy link

prometx commented Jun 16, 2015

I tried installing an earlier version (Apache Ant(TM) version 1.8.2) and still get the following error:

BUILD FAILED
/home/promet/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/promet/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:655: Execute failed: java.io.IOException: Cannot run program "/home/promet/Dev/kivy/PiBot/.buildozer/android/platform/python-for-android/dist/com.shivux.pibotremote/${aidl}": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
at com.android.ant.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102)
at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131)
at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 48 more

Total time: 1 second
private.mp3: /home/promet/Dev/kivy/PiBot/.buildozer/android/platform/python-for-android/dist/com.shivux.pibotremote/private/lib/python2.7/lib-dynload/future_builtins.so
assets/private.mp3: /home/promet/Dev/kivy/PiBot/.buildozer/android/platform/python-for-android/dist/com.shivux.pibotremote/private/include/python2.7/pyconfig.h
assets/private.mp3: /home/promet/Dev/kivy/PiBot/.buildozer/android/app/main.pyo
assets/private.mp3: /home/promet/Dev/kivy/PiBot/.buildozer/android/app/pibot_main.pyo
assets/private.mp3: /home/promet/Dev/kivy/PiBot/.buildozer/android/app/sitecustomize.pyo
Traceback (most recent call last):
File "build.py", line 508, in
make_package(args)
File "build.py", line 357, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

Command failed: /usr/bin/python2.7 build.py --name pibotremote --version 1.9.0 --package shivux.pibotremote.com.shivux.pibotremote --private /home/promet/Dev/kivy/PiBot/.buildozer/android/app --sdk 20 --minsdk 8 --orientation sensor debug

@prometx
Copy link

prometx commented Jun 16, 2015

Sorry about that end font, not sure how that happened...

@cbenhagen
Copy link
Contributor

According to http://stackoverflow.com/a/30815251 add this at line 484 of your build.xml:

<property name="aidl" location="${android.build.tools.dir}/aidl${exe}" />
<property name="aapt" location="${android.build.tools.dir}/aapt${exe}" />
<property name="dx" location="${android.build.tools.dir}/dx${bat}" />
<property name="zipalign" location="${android.build.tools.dir}/zipalign${exe}" />

@olymk2
Copy link

olymk2 commented Jun 16, 2015

I have hit this issue as well, strangely on a single machine my other one is still building. I can confirm that #206 does not fix the issue for me i removed ~/.buildozer before running.

also tried adding,



I already had all but the last line but that did not seem to help either :/

@prometx
Copy link

prometx commented Jun 16, 2015

cbenhagen, thanks man, that seems to have taken care of my problem, thanks very much for passing that along.

@olymk2
Copy link

olymk2 commented Jun 17, 2015

@cbenhagen i stand corrected this did fix it, i had a couple of build.xml files on my machine and edited the wrong one.

its all working now.

@Breakthrough
Copy link

I finally managed to fix this issue, having tried all the fixes discussed here to no avail... The solution for me was the same as that from issue #146, which I stumbled upon after finding this question on Stack Overflow) - the proper version of the required Android build tools were not installed (Build-tools rev.20).

After following these steps from #146 now I can build Android APKs with buildozer just fine. To summarize here, just run the SDK manager local to buildozer (e.g. run ~/.buildozer/android/platform/android-sdk-21/tools/android), hit Deselect All, and then check & download Android SDK Build-tools Rev. 20.

(Really loving Kivy & buildozer by the way, everything is working great now!)

@giuliano-macedo
Copy link

Thank you @Breakthrough now is working great

@etem
Copy link

etem commented Sep 4, 2015

Thank you @Breakthrough problem is solved!

@tito tito closed this as completed in 8e6556d Oct 4, 2015
@Inominatum
Copy link

Hello all. My problem was not fixed, i have the same problem with buildozer. The weird part is this: i work on VM(Linux Mint) and before shutting down VM all was good(i made few dozens of apk's) i shut down VM and after few hours i started it. No changes to python code, no changes to .spec file, just rebuilded the app and got this error with and, everything is up-to-date: buildozer, cython, android sdk, everything and still cuz the restart of VM nothing works anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants