首页 > 解决方案 > Kivy 应用无法在安卓手机上运行,​​但它可以在电脑上运行

问题描述

我在 debian 上使用 buildozer 制作 apk 时遇到一些问题:当我在 debian 上启动我的应用程序时,它可以工作,但是当我在我的 android 手机上启动它时,我得到了这个:

07-25 19:56:58.939 14073 14190 I python  : Android kivy bootstrap done. __name__ is __main__
07-25 19:56:58.939 14073 14190 I python  : AND: Ran string
07-25 19:56:58.939 14073 14190 I python  : Run user program, change dir and execute entrypoint
07-25 19:56:59.345 14073 14190 I python  : [WARNING] [Config      ] Older configuration version detected (0 instead of 21)
07-25 19:56:59.346 14073 14190 I python  : [WARNING] [Config      ] Upgrading configuration in progress.
07-25 19:56:59.360 14073 14190 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.test.myapp/files/app/.kivy/logs/kivy_19-07-25_0.txt
07-25 19:56:59.361 14073 14190 I python  : [INFO   ] [Kivy        ] v1.11.0
07-25 19:56:59.362 14073 14190 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.test.myapp/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
07-25 19:56:59.363 14073 14190 I python  : [INFO   ] [Python      ] v3.7.1 (default, Jul 23 2019, 20:08:31) 
07-25 19:56:59.363 14073 14190 I python  : [Clang 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55
07-25 19:56:59.365 14073 14190 I python  : [INFO   ] [Python      ] Interpreter at "android_python"
07-25 19:56:59.385 14073 14190 I python  : [ERROR  ] [Clock       ] Unable to import kivy._clock. Have you perhaps forgotten to compile kivy? Kivy contains Cython code which needs to be compiled. A missing kivy._clock often indicates the Cython code has not been compiled. Please follow the installation instructions and make sure to compile Kivy
07-25 19:56:59.387 14073 14190 I python  :  Traceback (most recent call last):
07-25 19:56:59.387 14073 14190 I python  :    File "/home/vlad/test/.buildozer/android/app/main.py", line 8, in <module>
07-25 19:56:59.389 14073 14190 I python  :    File "/home/vlad/test/.buildozer/android/platform/build/build/python-installs/myapp/kivy/app.py", line 319, in <module>
07-25 19:56:59.390 14073 14190 I python  :    File "/home/vlad/test/.buildozer/android/platform/build/build/python-installs/myapp/kivy/base.py", line 26, in <module>
07-25 19:56:59.392 14073 14190 I python  :    File "/home/vlad/test/.buildozer/android/platform/build/build/python-installs/myapp/kivy/clock.py", line 363, in <module>
07-25 19:56:59.395 14073 14190 I python  :  ImportError: dlopen failed: library "libpython2.7.so" not found
07-25 19:56:59.395 14073 14190 I python  : Python for android ended.

(日志来自 logcat)

我能做些什么来修复它?

PS 这是我的 buildozer.spec:https ://pastebin.com/DrVeqXt2

标签: pythonandroiddebiankivybuildozer

解决方案


我找到了解决方案 - 我刚刚使用了 vevnv 并安装了所有必要的库。


推荐阅读