Buildozer failing on Arch + questions on building configuration

442 views
Skip to first unread message

Goffi

unread,
Oct 5, 2016, 5:51:25 PM10/5/16
to Kivy users support
Hello,

I'm trying to use buildozer to port our XMPP client to Android. I'm compiling
using Arch Linux with aur/python2-buildozer-git. Note that "python" is Python
3 on Arch, but my application is Python 2.

The build is failing (traceback below), and I have a couple of questions:

1) how can I specify that I want python 2 and not python 3 in my APK ? If I
add python2 in requirements in buildozer.spec is it enough?

2) I have dependencies to local packages, how the requirements work in this
case? Actually is it taking packages (with no recipes) in pypi, or does it
copy it from my PYTHONPATH? My dependencies are pure python, so a recipe
should not be needed.

3) minor point, but buildozer is looking for main.py, can I specify an other
name?

4) I had to specify p4a.local_recipes = ./.buildozer/android/platform/python-
for-android-master/pythonforandroid/recipes in buildozer.spec


5) I have tried to do a build with just a few dependencies (I'm not expecting
to see the app running for the moment, I just want to success to create a
apk), and it's failing with the following trace below (just putting the
interesting part).


Thanks for any help, and for all this great work done :)

Goffi


-- BUILDOZER TRACE ---

[INFO]: -> directory context /home/goffi/dev/cagou/src/.buildozer/android/
platform/build/dists/myapp
/home/goffi/dev/cagou/src/.buildozer/android/platform/python-for-android-
master/pythonforandroid/logger.py:132: ResourceWarning: unclosed file
<_io.TextIOWrapper name=3 encoding='UTF-8'>
cols = max(25, int(os.popen('stty size', 'r').read().split()[1]))
[INFO]: -> running ant debug
[INFO]: STDOUT (last 20
lines of 90):
[dx] at java.lang.ClassLoader.defineClass(ClassLoader.java:
803)
[dx] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[dx] at java.net.URLClassLoader.defineClass(URLClassLoader.java:
449)
[dx] at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[dx] at java.security.AccessController.doPrivileged(Native Method)
[dx] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[dx] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
308)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[dx] at
sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

BUILD FAILED
/home/goffi/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:
888: The following error occurred while executing this line:
/home/goffi/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:
890: The following error occurred while executing this line:
/home/goffi/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:
902: The following error occurred while executing this line:
/home/goffi/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:
283: null returned: 1

Total time: 1 second
[INFO]: STDERR:

[INFO]: COMMAND:
cd /home/goffi/dev/cagou/src/.buildozer/android/platform/build/dists/myapp &&
/home/goffi/.buildozer/android/platform/apache-ant-1.9.4/bin/ant debug

[WARNING]: ERROR: /home/goffi/.buildozer/android/platform/apache-ant-1.9.4/
bin/ant failed!
# Command failed: python -m pythonforandroid.toolchain apk --bootstrap=sdl2 --
dist_name myapp --name 'My Application' --version 0.1 --package org.test.myapp
--android_api 19 --minsdk 9 --private /home/goffi/dev/cagou/src/.buildozer/
android/app --orientation landscape --copy-libs --local-recipes /home/goffi/
dev/cagou/src/.buildozer/android/platform/python-for-android-master/
pythonforandroid/recipes --color=always --storage-dir=/home/goffi/dev/cagou/
src/.buildozer/android/platform/build
#
# 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

Alexander Taylor

unread,
Oct 5, 2016, 7:40:07 PM10/5/16
to Kivy users support, go...@goffi.org
1) Just adding python2 in the requirements is fine.

2) requirements without recipes are pulled from pip. There isn't a convenient way to include local packages automatically, but you can just put them in your code folder.

3) python-for-android assumes a main.py entry point. It would be possible (and not hard) to add an option for something else, but nobody has done it. A PR adding this functionality would probably be welcome.

4) Thanks for the report, this is in the process of being fixed.

5) Could you post (or link to a pastebin with) the full log, not just this part?

Goffi

unread,
Oct 6, 2016, 7:02:51 AM10/6/16
to kivy-...@googlegroups.com
thanks for the quick reply

Le mercredi 5 octobre 2016, 16:40:07 CEST Alexander Taylor a écrit :
> 2) requirements without recipes are pulled from pip. There isn't a
> convenient way to include local packages automatically, but you can just
> put them in your code folder.

I've tried to use a symbolic link, it doesn't seems to work neither (would be
a simple workaround). I'm using a bind mount for the moment, it works fine.


> 3) python-for-android assumes a main.py entry point. It would be possible
> (and not hard) to add an option for something else, but nobody has done it.
> A PR adding this functionality would probably be welcome.

yes sure, that should be an easy entry point to the code, I'll check it when I
have some time


> 5) Could you post (or link to a pastebin with) the full log, not just this
> part?

yes, I realised than my buildozer.spec was not good (I have made a fresh one
and forgot to change the values), but after doing it I have a different error,
still related to ant:

https://paste.debian.net/857784/

here is the buildozer.spec:

https://paste.debian.net/857786/

thanks!

Goffi

Goffi

unread,
Oct 7, 2016, 8:10:41 AM10/7/16
to kivy-...@googlegroups.com
Le jeudi 6 octobre 2016, 12:59:48 CEST Goffi a écrit :
> > 5) Could you post (or link to a pastebin with) the full log, not just this
> > part?
>
> yes, I realised than my buildozer.spec was not good (I have made a fresh one
> and forgot to change the values), but after doing it I have a different
> error, still related to ant:
>
> https://paste.debian.net/857784/
>
> here is the buildozer.spec:
>
> https://paste.debian.net/857786/


Hello,

I've tried to install ubuntu version in a Docker image, and I have the same
result (ant related error), with android_new.

Tried to remove .buildozer then build in Ubuntu Docker image with old tool
chain (android), I have an other error, still related to ant:

https://paste.debian.net/858052/

This one seems related to a ticket already open: https://github.com/kivy/
buildozer/issues/406


any help welcome :)

thanks
Goffi

Goffi

unread,
Oct 7, 2016, 8:23:46 AM10/7/16
to kivy-...@googlegroups.com
Le vendredi 7 octobre 2016, 14:07:37 CEST Goffi a écrit :
> Tried to remove .buildozer then build in Ubuntu Docker image with old tool
> chain (android), I have an other error, still related to ant:
>
> https://paste.debian.net/858052/
>
> This one seems related to a ticket already open: https://github.com/kivy/
> buildozer/issues/406

Oh, I found a bug.

I was intrigued by the following line in buildozer logs:

[aapt] /cagou/src/.buildozer/android/platform/python-for-android/dist/cagou/
bin/AndroidManifest.xml:2: Tag <manifest> attribute package has invalid
character '-'.

after checking I realized it's because I have this in my buildozer.spec:

package.domain = org.salut-a-toi.cagou

by removing the "-" (using an other package.domaine = org.goffi.cagou), the
build seems to work.

Don't have time now to investigate more, but it seems than having dashes in
package.domain breaks the building process.

I have now an .apk in by bin dir (using old tool chain with Ubuntu Docker
image), It can't work has I have removed all dependencies, but it's a big step
in the right direction :)


Goffi

Ronaldo Freitas

unread,
Jan 20, 2017, 12:17:48 PM1/20/17
to Kivy users support, go...@goffi.org

try change java version.

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

its work to me
Reply all
Reply to author
Forward
0 new messages