Can't build simple app with buildozer

1,356 views
Skip to first unread message

Cochemuacos

unread,
Oct 11, 2014, 12:50:18 AM10/11/14
to kivy-...@googlegroups.com
Hello every one,

I've just finished my first app and it works fine in my computer, but when I try to build an apk using buildozer I get:

Available modules: android apsw audiostream c_igraph cymunk django docutils ffmpeg gevent greenlet hostpython igraph jpeg kivent kivy libevent libswift libxml2 libxslt lxml m2crypto msgpack mysql_connector netifaces numpy openssl paramiko pil plyer png polygon psutil pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python sdl setuptools sqlalchemy sqlite3 swift twisted txws wokkel zope
# Remove directory and subdirectory /home/cuau/Proyectos/Doge/.buildozer/applibs
# Create directory /home/cuau/Proyectos/Doge/.buildozer/applibs
# Run 'virtualenv --python=python2.7 ./venv'
# Cwd /home/cuau/Proyectos/Doge/.buildozer
/bin/sh: 1: virtualenv: not found
# Command failed: virtualenv --python=python2.7 ./venv


Since I don't really know what that means i tried to package the test app which appears in kivy's home page (The one that is only a button with text = 'hello world') but I couldn't do that either, I got:


 #error Do not use this file, it is the result of a failed Cython compilation.
 
^
 error
: command 'arm-linux-androideabi-gcc' failed with exit status 1
# Command failed: ./distribute.sh -m "kivy" -d "testapp"


So I have no idea what is going on, I thought there was something wrong with my original app, but since the test app won't build either, now I believe there is something missing in my computer.

Anyways, any help will be greatly appreciated.

Alexander Taylor

unread,
Oct 11, 2014, 9:43:43 AM10/11/14
to kivy-...@googlegroups.com
Set the buildozer log_level to 2 in the buildozer.spec, run the command again, and paste the full output.

Cochemuacos

unread,
Oct 12, 2014, 5:16:52 PM10/12/14
to kivy-...@googlegroups.com
Hi, sorry for the late reply. The output is in the file below.
log.text

Alexander Taylor

unread,
Oct 12, 2014, 5:18:11 PM10/12/14
to kivy-...@googlegroups.com
What's your distro? Do you have virtualenv installed?

On 12/10/14 22:16, Cochemuacos wrote:
> Hi, sorry for the late reply. The output is in the file below.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Kivy users support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/kivy-users/s5BAa0SEO6o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> kivy-users+...@googlegroups.com
> <mailto:kivy-users+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

0x6DB9E52F.asc
signature.asc

Cochemuacos

unread,
Oct 12, 2014, 5:19:10 PM10/12/14
to kivy-...@googlegroups.com
By the way, the output is from my app and not from the test app

Cochemuacos

unread,
Oct 12, 2014, 11:41:33 PM10/12/14
to kivy-...@googlegroups.com
I'm using Debian wheezy, and I didn't had virtualenv installed, completely forgot about that. However now that I have it installed I get a different error while trying to make the apk:

Total time: 1 second
app
/_applibs/sympy-0.7.5-py2.7.egg-info/installed-files.txt
Traceback (most recent call last):
 
File "build.py", line 497, in <module>
    make_package
(args)
 
File "build.py", line 351, 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 'My Application' --version 1.2.0 --package org.test.myapp --private /home/cuau/Proyectos/Doge/.buildozer/android/app --sdk 14 --minsdk 8 --orientation sensor --window debug


And a few lines above:

BUILD FAILED
/home/cuau/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/cuau/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:659: Execute failed: java.io.IOException: Cannot run program "/home/cuau/adt-bundle-linux-x86_64-20140702/sdk/build-tools/android-4.4W/aidl": error=2, No such file or directory


Which seems wired given that there is a file named aidl in /home/cuau/adt-bundle-linux-x86_64-20140702/sdk/build-tools/android-4.4W/

Thanks for all your help.

Ben Rousch

unread,
Oct 13, 2014, 6:32:09 AM10/13/14
to kivy-...@googlegroups.com
This error usually means you are running a 64bit OS without the 32bit libs that the Android SDK needs. On Ubuntu, you can fix it like this:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential ccache git zlib1g-dev python2.7 python2.7-dev libncurses5:i386 libstdc++6:i386 zlib1g:i386 unzip


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 Ben Rousch
   bro...@gmail.com
   http://clusterbleep.net/

Cochemuacos

unread,
Oct 13, 2014, 11:36:09 PM10/13/14
to kivy-...@googlegroups.com
Thank a lot guys, I managed to build the apk without problems. But now the app won't open in my phone.

Alexander Taylor

unread,
Oct 14, 2014, 5:10:16 AM10/14/14
to kivy-...@googlegroups.com
http://kivy.org/docs/guide/android.html#debugging-your-application-on-the-android-platform

On 14/10/14 04:36, Cochemuacos wrote:
> Thank a lot guys, I managed to build the apk without problems. But now
> the app won't open in my phone.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Kivy users support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/kivy-users/s5BAa0SEO6o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> kivy-users+...@googlegroups.com
> <mailto:kivy-users+...@googlegroups.com>.
0x6DB9E52F.asc
signature.asc

Cochemuacos

unread,
Oct 14, 2014, 6:24:12 PM10/14/14
to kivy-...@googlegroups.com
Ok, so i ran in the terminal:

buildozer android logcat

and got this, seems like there is something wrong with sympy.

I/ActivityManager( 1023): Start proc prueba.app.pruebaapp:python for activity prueba.app.pruebaapp/org.renpy.android.PythonActivity: pid=11313 uid=10136 gids={50136, 1028, 1015}
V
/python  (11313): metadata fullscreen is1
D
/dalvikvm(11313): Trying to load lib /data/app-lib/prueba.app.pruebaapp-1/libpython2.7.so 0x41fed330
D
/dalvikvm(11313): Added shared lib /data/app-lib/prueba.app.pruebaapp-1/libpython2.7.so 0x41fed330
D
/dalvikvm(11313): No JNI_OnLoad found in /data/app-lib/prueba.app.pruebaapp-1/libpython2.7.so 0x41fed330, skipping init
D
/dalvikvm(11313): Trying to load lib /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_io.so 0x41fed330
D
/dalvikvm(11313): Added shared lib /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_io.so 0x41fed330
D
/dalvikvm(11313): No JNI_OnLoad found in /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_io.so 0x41fed330, skipping init
D
/dalvikvm(11313): Trying to load lib /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/unicodedata.so 0x41fed330
D
/dalvikvm(11313): Added shared lib /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/unicodedata.so 0x41fed330
D
/dalvikvm(11313): No JNI_OnLoad found in /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/unicodedata.so 0x41fed330, skipping init
D
/dalvikvm(11313): Trying to load lib /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_sqlite3.so 0x41fed330
E
/dalvikvm(11313): dlopen("/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_sqlite3.so") failed: dlopen failed: library "/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_sqlite3.so" not found
D
/dalvikvm(11313): Trying to load lib /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_imaging.so 0x41fed330
E
/dalvikvm(11313): dlopen("/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_imaging.so") failed: dlopen failed: library "/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_imaging.so" not found
I
/python  (11313): Starting audio thread
I
/python  (11313): Initialize Python for Android
I
/python  (11313): ['/data/data/prueba.app.pruebaapp/files/lib/python2.7/site-packages', '/data/data/prueba.app.pruebaapp/files/lib/site-python']
I
/python  (11313): Android path ['/data/data/prueba.app.pruebaapp/files/lib/python27.zip', '/data/data/prueba.app.pruebaapp/files/lib/python2.7', '/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload', '/data/data/prueba.app.pruebaapp/files/lib/python2.7/site-packages', '/data/data/prueba.app.pruebaapp/files', '/data/data/prueba.app.pruebaapp/files/_applibs']
I
/python  (11313): Android kivy bootstrap done. __name__ is __main__
I
/python  (11313): Run user program, change dir and execute main.py
I
/python  (11313): [INFO              ] Kivy v1.8.0
I
/python  (11313): [INFO              ] [Logger      ] Record log in /data/data/prueba.app.pruebaapp/files/.kivy/logs/kivy_14-10-14_16.txt
I
/python  (11313): [INFO              ] [Factory     ] 157 symbols loaded
I
/python  (11313): [DEBUG             ] [Cache       ] register <kv.lang> with limit=None, timeout=Nones
I
/python  (11313): [DEBUG             ] [Cache       ] register <kv.image> with limit=None, timeout=60s
I
/python  (11313): [DEBUG             ] [Cache       ] register <kv.atlas> with limit=None, timeout=Nones
I
/python  (11313):  /data/data/prueba.app.pruebaapp/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
I
/python  (11313):  (ImportError: No module named cdrom)
I
/python  (11313): [INFO              ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
I
/python  (11313): [DEBUG             ] [Cache       ] register <kv.texture> with limit=1000, timeout=60s
I
/python  (11313): [DEBUG             ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600s
I
/python  (11313): [INFO              ] [Text        ] Provider: pygame
I
/python  (11313):  Traceback (most recent call last):
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/main.py", line 9, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/__init__.py", line 32, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/__init__.py", line 8, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/expr.py", line 7, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/evalf.py", line 27, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/containers.py", line 14, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/utilities/__init__.py", line 15, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/utilities/runtests.py", line 27, in <module>
I
/python  (11313):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/doctest.py", line 99, in <module>
I
/python  (11313):  ImportError: No module named unittest
I
/python  (11313): Python for android ended.
I
/ActivityManager( 1023): Process prueba.app.pruebaapp:python (pid 11313) has died.




Cochemuacos

unread,
Oct 14, 2014, 9:07:19 PM10/14/14
to kivy-...@googlegroups.com
I tried commenting the line in the main.py file where the import of sympy takes place, however in the buildozer.spec file i dind't removed sympy from the requirement list. The apk build was succesfull and now I can open the app in my phone, although i can't really do anything because i don't have sympy in main.py.

Alexander Taylor

unread,
Oct 14, 2014, 9:09:21 PM10/14/14
to kivy-...@googlegroups.com
The unittest module is blacklisted because it's normally irrelevant (it
probably should be here too, but I don't know what code is trying to
call it). You can add unittest to the whitelist file set in the
buildozer.spec to have it included, which should fix this.

On 14/10/14 23:24, Cochemuacos wrote:
> Ok, so i ran in the terminal:
>
> |
> buildozer android logcat
> |
>
> and got this, seems like there is something wrong with sympy.
>
> |
> I/ActivityManager(1023):Startproc prueba.app.pruebaapp:python
> foractivity
> prueba.app.pruebaapp/org.renpy.android.PythonActivity:pid=11313uid=10136gids={50136,1028,1015}
> V/python (11313):metadata fullscreen is1
> D/dalvikvm(11313):Tryingto load lib
> /data/app-lib/prueba.app.pruebaapp-1/libpython2.7.so0x41fed330
> D/dalvikvm(11313):Addedshared lib
> /data/app-lib/prueba.app.pruebaapp-1/libpython2.7.so0x41fed330
> D/dalvikvm(11313):NoJNI_OnLoad found
> in/data/app-lib/prueba.app.pruebaapp-1/libpython2.7.so0x41fed330,skipping init
> D/dalvikvm(11313):Tryingto load lib
> /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_io.so
> 0x41fed330
> D/dalvikvm(11313):Addedshared lib
> /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_io.so
> 0x41fed330
> D/dalvikvm(11313):NoJNI_OnLoad found
> in/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_io.so
> 0x41fed330,skipping init
> D/dalvikvm(11313):Tryingto load lib
> /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/unicodedata.so
> 0x41fed330
> D/dalvikvm(11313):Addedshared lib
> /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/unicodedata.so
> 0x41fed330
> D/dalvikvm(11313):NoJNI_OnLoad found
> in/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/unicodedata.so
> 0x41fed330,skipping init
> D/dalvikvm(11313):Tryingto load lib
> /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_sqlite3.so
> 0x41fed330
> E/dalvikvm(11313):dlopen("/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_sqlite3.so")failed:dlopen
> failed:library
> "/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_sqlite3.so"notfound
> D/dalvikvm(11313):Tryingto load lib
> /data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_imaging.so
> 0x41fed330
> E/dalvikvm(11313):dlopen("/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_imaging.so")failed:dlopen
> failed:library
> "/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload/_imaging.so"notfound
> I/python (11313):Startingaudio thread
> I/python (11313):InitializePythonforAndroid
> I/python
> (11313):['/data/data/prueba.app.pruebaapp/files/lib/python2.7/site-packages','/data/data/prueba.app.pruebaapp/files/lib/site-python']
> I/python (11313):Androidpath
> ['/data/data/prueba.app.pruebaapp/files/lib/python27.zip','/data/data/prueba.app.pruebaapp/files/lib/python2.7','/data/data/prueba.app.pruebaapp/files/lib/python2.7/lib-dynload','/data/data/prueba.app.pruebaapp/files/lib/python2.7/site-packages','/data/data/prueba.app.pruebaapp/files','/data/data/prueba.app.pruebaapp/files/_applibs']
> I/python (11313):Androidkivy bootstrap done.__name__ is__main__
> I/python (11313):Runuser program,change dir andexecute main.py
> I/python (11313):[INFO ]Kivyv1.8.0
> I/python (11313):[INFO ][Logger ]Recordlog
> in/data/data/prueba.app.pruebaapp/files/.kivy/logs/kivy_14-10-14_16.txt
> I/python (11313):[INFO ][Factory ]157symbols loaded
> I/python (11313):[DEBUG ][Cache
> ]register<kv.lang>withlimit=None,timeout=Nones
> I/python (11313):[DEBUG ][Cache
> ]register<kv.image>withlimit=None,timeout=60s
> I/python (11313):[DEBUG ][Cache
> ]register<kv.atlas>withlimit=None,timeout=Nones
> I/python
> (11313): /data/data/prueba.app.pruebaapp/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12:RuntimeWarning:importcdrom:Nomodulenamed
> cdrom
> I/python (11313): (ImportError:Nomodulenamed cdrom)
> I/python (11313):[INFO ][Image
> ]Providers:img_tex,img_dds,img_pygame,img_gif (img_pil ignored)
> I/python (11313):[DEBUG ][Cache
> ]register<kv.texture>withlimit=1000,timeout=60s
> I/python (11313):[DEBUG ][Cache
> ]register<kv.shader>withlimit=1000,timeout=3600s
> I/python (11313):[INFO ][Text ]Provider:pygame
> I/python (11313): Traceback(most recent call last):
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/main.py",line
> 9,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/__init__.py",line
> 32,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/__init__.py",line
> 8,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/expr.py",line
> 7,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/evalf.py",line
> 27,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/containers.py",line
> 14,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/utilities/__init__.py",line
> 15,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/utilities/runtests.py",line
> 27,in<module>
> I/python (11313):
> File"/home/cuau/Proyectos/DogeP/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/doctest.py",line
> 99,in<module>
> I/python (11313): ImportError:Nomodulenamed unittest
> I/python (11313):Pythonforandroid ended.
> I/ActivityManager(1023):Processprueba.app.pruebaapp:python (pid
> 11313)has died.
>
> |
>
>
>
0x6DB9E52F.asc
signature.asc

Cochemuacos

unread,
Oct 14, 2014, 10:30:09 PM10/14/14
to kivy-...@googlegroups.com
Hi, I'm not sure if I understood correctly. I changed this lines in the buildezer.spec file:

# (list) python-for-android whitelist
android
.p4a_whitelist = unittest

I packed again the apk but I'm still getting the same output while debugging the app in my phone.

I/python  ( 1877):  (ImportError: No module named cdrom)
I
/python  ( 1877): [INFO              ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
I
/python  ( 1877): [DEBUG             ] [Cache       ] register <kv.texture> with limit=1000, timeout=60s
I
/python  ( 1877): [DEBUG             ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600s
I
/python  ( 1877): [INFO              ] [Text        ] Provider: pygame
I
/python  ( 1877):  Traceback (most recent call last):
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/main.py", line 8, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/prueba.py", line 2, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/__init__.py", line 32, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/__init__.py", line 8, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/expr.py", line 7, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/evalf.py", line 27, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/core/containers.py", line 14, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/utilities/__init__.py", line 15, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/app/_applibs/sympy/utilities/runtests.py", line 27, in <module>
I
/python  ( 1877):    File "/home/cuau/Proyectos/DogeP/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/doctest.py", line 99, in <module>
I
/python  ( 1877):  ImportError: No module named unittest
I
/python  ( 1877): Python for android ended.
I
/ActivityManager( 1023): Process prueba.app.pruebaapp:python (pid 1877) has died.


Reply all
Reply to author
Forward
0 new messages