android.add_src option in buildozer.spec causes error

171 views
Skip to first unread message

Sahil Mahajan

unread,
Nov 13, 2015, 11:28:11 PM11/13/15
to Kivy users support
Hello, I am trying to use a java file in my android project. I wrote a .java file and edited the buildozer.spec by using the android.add_src option. When I run buildozer android debug, I get the error "subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1."

Moreover, all subsequent build attempts fail with the same error, even when I uncomment the android.add_src option. However, if I delete the apk and the .buildozer file, comment out the android.add_src option, and run buildozer android debug again, the apk builds successfully. When I uncomment out the android.add_src option and run buildozer android debug after this, I get the error message again. It seems that my using the android.add_src option breaks something in buildozer.

I checked online for solutions to this error. I tried installing libncurses5 and the rest, and also tried running ~/.buildozer/android/platform/android-sdk-21/tools/android and downloading Android SDK Build-tools Rev. 20. These solutions worked before when I ran into the same problem, but now they no longer work and I am stuck.

Please let me know if there is any more information that might be helpful in finding a solution. Thank you.

Alexander Taylor

unread,
Nov 14, 2015, 7:39:59 AM11/14/15
to Kivy users support
There's probably something invalid about the src you add. Try navigating to the python-for-android dists directory in buildozer (something like .buildozer/android/platform/python-for-android/dists/distname) and run 'ant debug' to see the specific debug output.

Sahil Mahajan

unread,
Nov 28, 2015, 7:20:09 PM11/28/15
to Kivy users support
That worked. I ran ant debug in /.buildozer/android/platform/python-for-android/dist/distname, and found an error in my .java file from the output. I found what was invalid and corrected it. Running ant debug now builds successfully, and running buildozer android debug builds the apk successfully. Thank you so much for your help!
Reply all
Reply to author
Forward
0 new messages