Dan Alan
Dan Alan

Reputation: 1

kivy app crashes right after the kivy starting animation (on my phone)

I have been trying to deploy a very basic app for my android but it the app crashes right after the kivy starting animation (on my phone). I have tried using Google Colab as well as Ubuntu but it says the same thing. it says you are using old version of kivy despite installing kivy 2 on both cases. any help is really apperciated

I followed this tutorial:

https://towardsdatascience.com/3-ways-to-convert-python-app-into-apk-77f4c9cd55af

here is the logcat from my phone:

• 06-10 10:57:41.867 22615 22662 I python  : Android kivy bootstrap done. __name__ is __main__
• 06-10 10:57:41.867 22615 22662 I python  : AND: Ran string
• 06-10 10:57:41.867 22615 22662 I python  : Run user program, change dir and execute entrypoint
• 06-10 10:57:42.121 22615 22662 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.test.bindula/files/app/.kivy/logs/kivy_21-06-10_7.txt
• 06-10 10:57:42.121 22615 22662 I python  : [INFO   ] [Kivy        ] v1.11.1
• 06-10 10:57:42.121 22615 22662 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.test.bindula/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
• 06-10 10:57:42.121 22615 22662 I python  : [INFO   ] [Python      ] v3.8.1 (default, Jun 10 2021, 00:40:04)
• 06-10 10:57:42.121 22615 22662 I python  : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462
• 06-10 10:57:42.122 22615 22662 I python  : [INFO   ] [Python      ] Interpreter at ""
• 06-10 10:57:43.160 22615 22662 I python  : [INFO   ] [Factory     ] 184 symbols loaded
• 06-10 10:57:43.719 22615 22662 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
• 06-10 10:57:43.770 22615 22662 I python  :  Traceback (most recent call last):
• 06-10 10:57:43.771 22615 22662 I python  :    File "/home/onworks/Downloads/.buildozer/android/app/main.py", line 5, in <module>
• 06-10 10:57:43.771 22615 22662 I python  :    File "/home/onworks/Downloads/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/bindula/kivy/lang/builder.py", line 368, in load_string
• 06-10 10:57:43.772 22615 22662 I python  :    File "/home/onworks/Downloads/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/bindula/kivy/lang/parser.py", line 401, in __init__
• 06-10 10:57:43.773 22615 22662 I python  :    File "/home/onworks/Downloads/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/bindula/kivy/lang/parser.py", line 507, in parse
• 06-10 10:57:43.774 22615 22662 I python  :    File "/home/onworks/Downloads/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/bindula/kivy/lang/parser.py", line 413, in execute_directives
• 06-10 10:57:43.775 22615 22662 I python  :    File "/home/onworks/Downloads/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/bindula/kivy/__init__.py", line 138, in require
• 06-10 10:57:43.775 22615 22662 I python  :  Exception: The version of Kivy installed on this system is too old. (You have 1.11.1, but the application requires 2.0.0)
• 06-10 10:57:43.775 22615 22662 I python  : Python for android ended.

^C

Upvotes: 0

Views: 700

Answers (3)

user16240688
user16240688

Reputation:

You should try downloading kivy 2.0.0rc4 in plugins. So your buildozer.spec will be:

# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==2.0.0rc4

Upvotes: 1

Big-Omelette
Big-Omelette

Reputation: 106

It says you have old version of kivy 1.11.1 and you need to upgrade it to kivy =2.0.0 , you can just add this into the buildozer spec file requirements.

You can try to reinstall

You can see your current version of package install by using this command in cmd. pip list

https://kivy.org/doc/stable/gettingstarted/installation.html#install-pip

After you application is built you can deploy your app and filter all the python logs .

buildozer -v android debug deploy run |grep python

Upvotes: 0

XBOT
XBOT

Reputation: 46

The Problem May Occur For Two Different Reasons

--> The 3rd Party Modules Used In Python File Are Not Added In Buildozer.spec file

-->There Is A Error In Your Python Code Which Makes Your App To Crash

--> Using Different Version Of The Kivy/Kivmd Versions..

As The Logcat Says, You Wrote Your Code With Latest Kivy Version And Compiled it With Lower Version - As There Are many changes from kivy 1.11.1 to 2.0.0

[Refers this to see the changelogs : https://kivy.org/doc/stable/changelog.html]

Don't Worry , I Have Solutions :)

The Best And Time Saving Method Is To Upgrade Your Kivy Version To 2.0.0 and delete the .buildozer file and compile again.

If Your App Still Crashes - Check That You Added All Modules[No Need To Add Inbuilt Modules In Python] in the requirements line in the .spec file

Make Sure That You Do not Have Any Python Errors In Python By Running The App At least Once Before compiling.

Upvotes: 0

Related Questions