python - Kivy 应用程序无法在 Android 手机上运行,​​但可以在计算机上运行

标签 python android debian kivy buildozer

我在 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)

我可以做什么来修复它?

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

最佳答案

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

关于python - Kivy 应用程序无法在 Android 手机上运行,​​但可以在计算机上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57205131/

相关文章:

android - RecyclerView 将信息传递给 Activity

python - apt-get 在 bash 脚本中没有按预期工作

Node.js 已安装但无法使用

debian - 如何从命令行手动重新启动或停止 virtuoso

python - Django:无法更改默认语言

python - 一组独特的列表

java - Android单元测试: How do I test this?

带后缀的Android Edittext

python - 如何通过pandas中的列列表创建新列?

python - 在 Python Pandas 中将列转换为行