buildozer apk crashing at startup Android

2,633 views
Skip to first unread message

Stephen Rafferty

unread,
Jul 21, 2016, 8:09:17 AM7/21/16
to Kivy users support
Hi guys.

I have a Kivy app that works when run on my Mac just fine.  When I use buildozer, it goes ahead and creates the relevant apk file.  But it always crashes when I start it up.  Standard message is 'Unfortunately, NAME OF APP has stopped'.

My app compiles to around 7.5Mb.  Not sure if that's big?  All it really does for the most part is navigate the user between a bunch of screens.  The only thing else it does is make SQL calls to a hosted db with my web provider.  This works fine running on my Mac.  I have assumed that I've needed to add an additional requirement of 'mysql_connector' since I've used that import in my code.

Any help would be most useful as this is an app I'm building for a Uni project.

Stephen.
buildozer.spec
log.txt

Antonio Cuni

unread,
Jul 21, 2016, 8:16:15 AM7/21/16
to kivy-...@googlegroups.com

Hi,
you should log at Android's logcat to see what is the error.
Make sure that you enabled usb debugging on your phone, connect it to the computer and execute:
   adb logcat -s python
then execute your app and see what it says.

ciao,
Anto


--
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.

Stephen Rafferty

unread,
Jul 21, 2016, 8:26:56 AM7/21/16
to kivy-...@googlegroups.com
Thanks for that.  Here is the output I got -  Tried to run the app twice.  Does this make any sense?

StephenrtysiMac:platform-tools srafferty73$ ./adb logcat -s python
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
- waiting for device -
--------- beginning of system
--------- beginning of crash
--------- beginning of main
07-21 13:20:23.269 26133 26133 V python  : metadata fullscreen is0
07-21 13:20:23.451 26133 26150 I python  : presplash-fit is null
07-21 13:20:23.452 26133 26150 I python  : presplash (fit=null) mx=1.406250,my=2.242188
07-21 13:24:17.535 26469 26469 V python  : metadata fullscreen is0
07-21 13:24:17.676 26469 26486 I python  : presplash-fit is null
07-21 13:24:17.677 26469 26486 I python  : presplash (fit=null) mx=1.406250,my=2.242188
07-21 13:24:58.906 26753 26753 V python  : metadata fullscreen is0
07-21 13:24:59.037 26753 26771 I python  : presplash-fit is null
07-21 13:24:59.046 26753 26771 I python  : presplash (fit=null) mx=1.406250,my=2.242188
07-21 13:25:20.442 26828 26828 V python  : metadata fullscreen is0
07-21 13:25:20.606 26828 26846 I python  : presplash-fit is null
07-21 13:25:20.610 26828 26846 I python  : presplash (fit=null) mx=1.406250,my=2.242188
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/PN5bsJ7Xw3Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.

Antonio Cuni

unread,
Jul 21, 2016, 8:28:57 AM7/21/16
to kivy-...@googlegroups.com

well, it's obviously truncated. The relevant infos are probably at the bottom. And please paste it as texts, not as a screenshot :-)

Stephen Rafferty

unread,
Jul 21, 2016, 8:33:28 AM7/21/16
to Kivy users support
Sorry about that.  I've ran it again.  It wasn't truncated.  That's as much information as it offered me back.  Is there some way of getting a more verbose response?  Here is the text of it, having tried to open the apk on my phone 3 times:

Last login: Thu Jul 21 13:19:03 on ttys000
StephenrtysiMac:~ srafferty73$ ./adb logcat -s python
-bash: ./adb: No such file or directory
StephenrtysiMac:~ srafferty73$ cd /Users/Srafferty73/Library/Android/sdk/platform-tools
StephenrtysiMac:platform-tools srafferty73$ ./adb logcat -s python
--------- beginning of system
--------- beginning of crash
--------- beginning of main
07-21 13:24:58.906 26753 26753 V python  : metadata fullscreen is0
07-21 13:24:59.037 26753 26771 I python  : presplash-fit is null
07-21 13:24:59.046 26753 26771 I python  : presplash (fit=null) mx=1.406250,my=2.242188
07-21 13:25:20.442 26828 26828 V python  : metadata fullscreen is0
07-21 13:25:20.606 26828 26846 I python  : presplash-fit is null
07-21 13:25:20.610 26828 26846 I python  : presplash (fit=null) mx=1.406250,my=2.242188
07-21 13:30:52.459 27128 27128 V python  : metadata fullscreen is0
07-21 13:30:52.598 27128 27146 I python  : presplash-fit is null
07-21 13:30:52.599 27128 27146 I python  : presplash (fit=null) mx=1.406250,my=2.242188
07-21 13:31:00.873 27159 27159 V python  : metadata fullscreen is0
07-21 13:31:01.018 27159 27177 I python  : presplash-fit is null
07-21 13:31:01.018 27159 27177 I python  : presplash (fit=null) mx=1.406250,my=2.242188

There is nothing beyond the above shown in the Terminal.

Thanks again.

Stephen.

Antonio Cuni

unread,
Jul 21, 2016, 8:37:05 AM7/21/16
to kivy-...@googlegroups.com

oh ok, sorry for the misunderstanding :-).
If you run logcat without -s you can see all the other messages, if you are lucky there will be something which hints to the problem. However, beware that logcat output is very verbose, so it will be probably hidden between lots of irrelevant messages

Stephen Rafferty

unread,
Jul 21, 2016, 8:49:54 AM7/21/16
to Kivy users support
Wow, you're not joking! :D

So, I waded through that output and searched for what I think is relevant log data (i.e. searched for the name of my app and noticed 'beginning of crash data').  Hopefully, the attached log will shed some light.

I see a FATAL ERROR and an unsatisfied java link error of some description.  Not sure what's going on here.

As always, any help would be great.

Stephen.
crashlog.txt

Antonio Cuni

unread,
Jul 21, 2016, 9:30:18 AM7/21/16
to kivy-...@googlegroups.com
it seems you are not the first to have this problem:

​I suppose that the problem resides in how python-for-android compiles the host Python.
​I quickly looke​
​d at ​
​Python's source code and I found this in Modules/_math.h


#ifdef HAVE_ASINH
#define m_asinh asinh
#else
/* if the system doesn't have asinh, use the substitute
   function defined in Modules/_math.c. */
#define m_asinh _Py_asinh
#endif

​So, here is my guess:

1. ​for some reason, on your cross-compilation toolchain the function asinh is not available, so that Python uses its own
2. for some other reason, Modules/_math.c is NOT included in the compilation
3. the result is that Python tries to look for _Py_asinh and it cannot find it

I suppose it is a bug in the hostpython recipe of python-for-android. You might want to try to setup an ubuntu virtualbox and use it for compiling the APKs, it might be easier than debugging it :).

I am sorry but I think I cannot help more after this point, I hope you'll be able to solve it somehow. But if you do please tell us, I am curious now :)

ciao,
Antp

Stephen Rafferty

unread,
Jul 22, 2016, 5:34:19 AM7/22/16
to Kivy users support
OK, following your advice, I then set up Ubuntu on Virtual box and have managed to get my kivy app running on it. 

However, when I try to compile the apk this way again using buildozer, I now get all the way through but then it fails at the last hurdle, as per the following Terminal message:

subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: python build.py --name 'D2C Test' --version 1.0 --package org.test.d2ctest --sdk 19 --minsdk 9 --private /home/srafferty73/Downloads/.buildozer/android/app --orientation sensor 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 further advice to complete the build would me most welcome.

Stephen.

Stephen Rafferty

unread,
Jul 22, 2016, 7:34:40 AM7/22/16
to Kivy users support
I've found out that the way to fix it for me was to change the App name to a name without spaces.  This allowed me to successfully build the apk.  Thanks for all your help.

Antonio Cuni

unread,
Jul 22, 2016, 6:26:16 PM7/22/16
to kivy-...@googlegroups.com

good, I'm glad you have solved. You are welcome :-)


Reply all
Reply to author
Forward
0 new messages