App 'HelloWorld' in APK crashes on kivy + any import libs (requests,bs4)

86 views
Skip to first unread message

Матвей К

unread,
Nov 19, 2020, 11:55:57 AM11/19/20
to Kivy users support
the application "Hello World" crashes when I add any import there.
(import request OR bs4 OR any libs)
on linux it works, but APK on my Mi9se do not work - loading... and crash!
Help please - I can't find the answer anywhere.
main.py
buildozer.spec
Error fron apk.txt

planckp...@gmail.com

unread,
Nov 19, 2020, 12:20:12 PM11/19/20
to Kivy users support
1) Re-check the build log for any errors that don't say expected

2) No idea, something is breaking Android really bad. Usually that is an Android API call at a time it does not expect it.
Globally static API calls can do this, but I would not expect load_string() to talk to the Android API (the key word there is expect)
I'm guessing here (I don't use kv) : to debug try removing the Build.load_string and put a Label() in build().

planckp...@gmail.com

unread,
Nov 25, 2020, 4:30:31 PM11/25/20
to Kivy users support
I finally got time to look at this. It there were 3 run time errors from Python all of the form:

11-25 11:16:26.340 16591 16624 I python  :  Traceback (most recent call last):
11-25 11:16:26.340 16591 16624 I python  :    File "/home/bobf/ex/test/.buildozer/android/app/main.py", line 4, in <module>
11-25 11:16:26.341 16591 16624 I python  :    File "/home/bobf/ex/test/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/SuperApp/requests/__init__.py", line 43, in <module>
11-25 11:16:26.341 16591 16624 I python  :  ModuleNotFoundError: No module named 'urllib3'
11-25 11:16:26.341 16591 16624 I python  : Python for android ended.

Added the missing packages that requests depends on to the requirements and all was fine:

requirements = python3,kivy,requests,bs4,urllib3,chardet,idna

Матвей К

unread,
Nov 29, 2020, 6:43:29 AM11/29/20
to Kivy users support
Hey.
Thanks for taking the time to find the problem.
But the point here is not the addition of the urllib3, chardet, idna libraries. After adding them, nothing has changed. The application crashes at the time of loading.
I have not had any compilation errors before.
Without importing BS4 and requests, everything works, but it is this import that, even without using it, kills everything.
Could some other additional information shed light on this situation?
I attach a log with compilation of the application
четверг, 26 ноября 2020 г. в 02:30:31 UTC+5, planckp...@gmail.com:
log compill with buildozer.txt

planckp...@gmail.com

unread,
Nov 29, 2020, 11:06:23 AM11/29/20
to Kivy users support
Run the debugger to see why the app is crashing.

urllib3, chardet, idna  are for requests

bs4 probably depends on other packages and doesn't specify them in its package.
You need to add these to requirements, in essence telling buildozer what was installed with pip3 on the desktop.
The debugger will show a message in the form of my previous post.
Reply all
Reply to author
Forward
0 new messages