buildozer icon indicating copy to clipboard operation
buildozer copied to clipboard

Python 3.9 failing to load kivy

Open syleishere opened this issue 3 years ago • 13 comments

Obfusk's patches for python-for-android: https://github.com/kivy/python-for-android/pull/2337/files/f55af300a95eccec877a21ab12456bec906988a5

OK I got around to testing obfusk's patch, something still needs patching: TEST SETUP AS FOLLOWS:

Python 3.8 buildozer test with obfusk's patches: buildozer.spec: (relevant lines for testing helloworld from kivy site) requirements = python3==3.8.6,hostpython3==3.8.6,kivy==2.0.0rc4,https://github.com/kivymd/KivyMD/archive/master.zip,pygments,sdl2_ttf==2.0.15 #obfusk's patches p4a.source_dir = %(source.dir)s/../python-for-android RESULTS from logcat on Pixel 4 XL: (PASS) http://sunsaturn.com/kivy/3.8.txt

Python 3.9 buildozer test with obfusk's patches: buildozer.spec: (relevant lines for testing helloworld from kivy site) requirements = python3==3.9.0,hostpython3==3.9.0,kivy==2.0.0rc4,https://github.com/kivymd/KivyMD/archive/master.zip,pygments,sdl2_ttf==2.0.15 #obfusk's patches p4a.source_dir = %(source.dir)s/../python-for-android RESULTS from logcat on Pixel 4 XL: (FAIL) http://sunsaturn.com/kivy/3.9.txt

Additional comments: only thing that affects it failing is (python3==3.9.0,hostpython3==3.9.0) after running numerous tests with different modules like kivymd or just setting python3==3.9.0,hostpython3==3.9.0,kivy==2.0.0rc4 only in requirements line. As you can see from logs, kivy is not getting loaded for some reason

syleishere avatar Dec 02 '20 04:12 syleishere

This is a bug in kivy.

obfusk avatar Dec 03 '20 19:12 obfusk

Nice job finding that kivy bug obfusk. If we can get these commits in kivy master and on python-for-android, whole world can start using python 3.9 on android 👍

syleishere avatar Dec 03 '20 20:12 syleishere

is it fixed by now?? as I checked Python 3.9 don't have Python 2 supports. so it should be quite lighter than the older 3.* versions and its should be helpful for building smaller apk i guess

RaSan147 avatar Jan 02 '21 15:01 RaSan147

AFAIK it's fixed, but you need to use kivy==master,python3==3.9.1,hostpython3==3.9.1 (for now).

obfusk avatar Jan 02 '21 16:01 obfusk

getting too many errors. Re-running and will send the error messages here

RaSan147 avatar Jan 03 '21 10:01 RaSan147

AFAIK it's fixed, but you need to use kivy==master,python3==3.9.1,hostpython3==3.9.1 (for now).

here are the logs. using ubuntu (actually lubuntu due to storage shortage) 20.04 and builtin python3.8.1

.spec file: buildoze.spec pastebin terminal log: terminal log pastebin

RaSan147 avatar Jan 03 '21 10:01 RaSan147

@Ratulhasan14789

You also need p4a.branch = develop. And the second paste you linked gives me a 403 error.

obfusk avatar Jan 03 '21 11:01 obfusk

01-11 20:14:22.728 16052 16090 I python : Android kivy bootstrap done. name is main 01-11 20:14:22.728 16052 16090 I python : AND: Ran string 01-11 20:14:22.728 16052 16090 I python : Run user program, change dir and execute entrypoint 01-11 20:14:22.844 16052 16090 I python : Traceback (most recent call last): 01-11 20:14:22.844 16052 16090 I python : File "/home/dan/python/apps/sunsaturn/helloworld/.buildozer/android/app/main.py", line 5, in 01-11 20:14:22.844 16052 16090 I python : File "/home/dan/python/apps/sunsaturn/helloworld/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/hellow orld/aiomysql/init.py", line 32, in 01-11 20:14:22.844 16052 16090 I python : File "/home/dan/python/apps/sunsaturn/helloworld/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/hellow orld/aiomysql/connection.py", line 19, in 01-11 20:14:22.844 16052 16090 I python : ModuleNotFoundError: No module named 'pymysql.util' 01-11 20:14:22.844 16052 16090 I python : Python for android ended.

develop branch breaks other things however: my typical build specs: requirements = python3==3.9.0,hostpython3==3.9.0,kivy==2.0.0,https://github.com/kivymd/KivyMD/archive/master.zip,aiomysql,pymysql,setuptools==51.0.0,pygments,sdl2_ttf== 2.0.15 OR: requirements = python3==3.8.6,hostpython3==3.8.6,kivy==2.0.0,https://github.com/kivymd/KivyMD/archive/master.zip,aiomysql,pymysql,setuptools==51.0.0,pygments,sdl2_ttf== 2.0.15

will break under p4a.branch=develop

syleishere avatar Jan 12 '21 02:01 syleishere

Hold up on that, it's for some reason breaking on master branch as well all of a sudden.

syleishere avatar Jan 12 '21 02:01 syleishere

Ok I looked into that error seems was just someone updated pymysql and that broke aiomysql was able to fix under python 3.8.6 with: requirements = python3==3.8.6,hostpython3==3.8.6,kivy==2.0.0,https://github.com/kivymd/KivyMD/archive/master.zip,aiomysql==0.0.21,pymysql==0.9.3,setuptools==51.0.0,pygments,sdl2_ttf==2.0.15

p4a.branch = develop

syleishere avatar Jan 12 '21 08:01 syleishere

SO I ran a simple hello world example test with: p4a.branch = develop requirements = python3==3.9.0,hostpython3==3.9.0,kivy==2.0.0rc4 also: requirements = python3==3.9.1,hostpython3==3.9.1,kivy==2.0.0 also: requirements = python3==3.9.0,hostpython3==3.9.0,kivy==2.0.0

All of them all of a sudden DO NOT load kivy. So kivy codebase is broken once again....

It should be noted simply replacing with 3.8.6 works in all examples including post before this one, so something is broken in kivy core again.

This was working in December, not sure what happened.

syleishere avatar Jan 12 '21 08:01 syleishere

Unfortunately, the fix in kivy didn't make it into 2.0.0. ATM you need to use master.

obfusk avatar Jan 19 '21 10:01 obfusk