Kivy-based APK just exits on my Android device when run

49 views
Skip to first unread message

Marlo C

unread,
Feb 9, 2018, 1:44:33 AM2/9/18
to kivy-...@googlegroups.com
I created an app that I packaged for Android using Buildozer. I use the Kivy website's Ubuntu VM and run the following code:
$ buildozer init

I then made the following changes to buildozer.spec:
requirements = sympy, kivy

orientation
= all

android
.p4a_whitelist = unittest/*,timeutils/*

Then I execute the command:
$ buildozer -v android debug

and once it builds, I install the APK onto my device using adb install.

The reason why I added unittest and timeutils to the whitelist is because I've been getting
ImportError: no module named unittest
and
ImportError: no module named timeutils

when I run logcat then start the app. As always, when I run the app on my Android device, the app would only show me the default Kivy loading screen, then exits. It doesn't go to the screen that I created, at all.

My Android device is a Samsung Galaxy S7 Edge running Android version 7

This is part of the log:
02-09 08:51:47.607 20695 20752 I python  :  Traceback (most recent call last):
02-09 08:51:47.608 20695 20752 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/main.py", line 12, in <module>
02-09 08:51:47.608 20695 20752 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/__init__.py", line 57, in <module>
02-09 08:51:47.609 20695 20752 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/core/__init__.py", line 8, in <module>
02-09 08:51:47.609 20695 20752 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/core/expr.py", line 6, in <module>
02-09 08:51:47.610 20695 20752 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/core/evalf.py", line 28, in <module>
02-09 08:51:47.610 20695 20752 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/utilities/__init__.py", line 20, in <module>
02-09 08:51:47.611 20695 20752 I python  :  ImportError: No module named timeutils
02-09 08:51:47.671 20695 20752 I python  : Python for android ended.
02-09 08:51:47.674 20695 20752 I art     : System.exit called, status: 0
02-09 08:51:47.675 20695 20752 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.


Also, this:
02-09 08:51:57.920 20839 20857 I python  :  Traceback (most recent call last):
02-09 08:51:57.921 20839 20857 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/main.py", line 12, in <module>
02-09 08:51:57.921 20839 20857 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/__init__.py", line 57, in <module>
02-09 08:51:57.922 20839 20857 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/core/__init__.py", line 8, in <module>
02-09 08:51:57.922 20839 20857 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/core/expr.py", line 6, in <module>
02-09 08:51:57.923 20839 20857 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/core/evalf.py", line 28, in <module>
02-09 08:51:57.923 20839 20857 I python  :    File "/home/kivy/Desktop/Recon/.buildozer/android/app/_applibs/sympy/utilities/__init__.py", line 20, in <module>
02-09 08:51:57.924 20839 20857 I python  :  ImportError: No module named timeutils
02-09 08:51:57.970 20839 20857 I python  : Python for android ended.

I've done a lot of research on why I'm getting these errors. So far, I've installed celery version 3.1.17 (as I've heard the latest version still has issues with timeutils). I don't know if I even need celery at all.

I attached the entire project on this post, hoping that you can help me fix this issue. Thank you very much!


Recon-20180209T062843Z-001.zip

Alexander Taylor

unread,
Feb 13, 2018, 4:54:01 PM2/13/18
to Kivy users support
I once made a sympy recipe, which I think worked in the end. I've now done a PR for it at https://github.com/kivy/python-for-android/pull/1236 , if you were able to test it that would be great.

The problem is to do with how timeutils (and some other sympy modules) include unicode characters. I think I found a better way to fix it than patching it crudely (which means these characters won't appear correctly if you do use them), but I can't remember what it was offhand.
Reply all
Reply to author
Forward
0 new messages