当我在我的 Android 手机 (Samsung GSIII) 上启动我的 Kivy 应用程序时,会出现启动画面,然后它会崩溃并返回到我之前的屏幕。在跟踪和错误之后,我确定了我的 ws4py 导入导致错误的事实。
我在要求下将 ws4py 添加到我的 buildozer.spec 文件中requirements = kivy,ws4py
,并且它似乎在运行时正确下载$>buildozer android debug
。查看 ws4py 的源代码并阅读文档,除了标准库中的模块之外没有其他导入,因此它似乎不是依赖问题(但也许是?)。
DDMS 日志在这里:
05-02 09:17:29.677: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libsdl.so 0x422833c8
05-02 09:17:29.687: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libsdl.so 0x422833c8
05-02 09:17:29.687: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libsdl_image.so 0x422833c8
05-02 09:17:29.697: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libsdl_image.so 0x422833c8
05-02 09:17:29.697: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libsdl_image.so 0x422833c8, skipping init
05-02 09:17:29.697: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libsdl_ttf.so 0x422833c8
05-02 09:17:29.697: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libsdl_ttf.so 0x422833c8
05-02 09:17:29.697: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libsdl_ttf.so 0x422833c8, skipping init
05-02 09:17:29.697: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libsdl_mixer.so 0x422833c8
05-02 09:17:29.707: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libsdl_mixer.so 0x422833c8
05-02 09:17:29.707: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libsdl_mixer.so 0x422833c8, skipping init
05-02 09:17:29.707: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libpython2.7.so 0x422833c8
05-02 09:17:29.727: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libpython2.7.so 0x422833c8
05-02 09:17:29.727: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libpython2.7.so 0x422833c8, skipping init
05-02 09:17:29.727: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libapplication.so 0x422833c8
05-02 09:17:29.727: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libapplication.so 0x422833c8
05-02 09:17:29.727: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libapplication.so 0x422833c8, skipping init
05-02 09:17:29.727: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libsdl_main.so 0x422833c8
05-02 09:17:29.727: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libsdl_main.so 0x422833c8
05-02 09:17:29.737: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libsdl_main.so 0x422833c8, skipping init
05-02 09:17:29.737: D/dalvikvm(22120): Trying to load lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_io.so 0x422833c8
05-02 09:17:29.737: D/dalvikvm(22120): Added shared lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_io.so 0x422833c8
05-02 09:17:29.737: D/dalvikvm(22120): No JNI_OnLoad found in /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_io.so 0x422833c8, skipping init
05-02 09:17:29.737: D/dalvikvm(22120): Trying to load lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/unicodedata.so 0x422833c8
05-02 09:17:29.747: D/dalvikvm(22120): Added shared lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/unicodedata.so 0x422833c8
05-02 09:17:29.747: D/dalvikvm(22120): No JNI_OnLoad found in /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/unicodedata.so 0x422833c8, skipping init
05-02 09:17:29.747: D/dalvikvm(22120): Trying to load lib /data/app-lib/com.shufudesign.drmb-2/libsqlite3.so 0x422833c8
05-02 09:17:29.757: D/dalvikvm(22120): Added shared lib /data/app-lib/com.shufudesign.drmb-2/libsqlite3.so 0x422833c8
05-02 09:17:29.757: D/dalvikvm(22120): No JNI_OnLoad found in /data/app-lib/com.shufudesign.drmb-2/libsqlite3.so 0x422833c8, skipping init
05-02 09:17:29.757: D/dalvikvm(22120): Trying to load lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_sqlite3.so 0x422833c8
05-02 09:17:29.757: D/dalvikvm(22120): Added shared lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_sqlite3.so 0x422833c8
05-02 09:17:29.757: D/dalvikvm(22120): No JNI_OnLoad found in /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_sqlite3.so 0x422833c8, skipping init
05-02 09:17:29.767: D/dalvikvm(22120): Trying to load lib /data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_imaging.so 0x422833c8
05-02 09:17:29.767: E/dalvikvm(22120): dlopen("/data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_imaging.so") failed: dlopen failed: library "/data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload/_imaging.so" not found
05-02 09:17:30.488: I/python(22120): ['/data/data/com.shufudesign.drmb/files/lib/python2.7/site-packages', '/data/data/com.shufudesign.drmb/files/lib/site-python']
05-02 09:17:30.488: I/python(22120): Android path ['/data/data/com.shufudesign.drmb/files/lib/python27.zip', '/data/data/com.shufudesign.drmb/files/lib/python2.7', '/data/data/com.shufudesign.drmb/files/lib/python2.7/lib-dynload', '/data/data/com.shufudesign.drmb/files/lib/python2.7/site-packages', '/data/data/com.shufudesign.drmb/files', '/data/data/com.shufudesign.drmb/files/lib/python2.7/site-packages/PIL', '/data/data/com.shufudesign.drmb/files/_applibs']
05-02 09:17:30.908: I/python(22120): [INFO ] [Logger ] Record log in /data/data/com.shufudesign.drmb/files/.kivy/logs/kivy_14-05-02_0.txt
05-02 09:17:31.990: I/python(22120): /data/data/com.shufudesign.drmb/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
05-02 09:17:32.250: I/ActivityManager(610): Process com.shufudesign.drmb:python (pid 22120) (adj 0) has died.
05-02 09:17:32.250: W/ActivityManager(610): Force removing ActivityRecord{42ed13d0 u0 com.shufudesign.drmb/org.renpy.android.PythonActivity}: app died, no saved state
我检查了一些关于 kivy 和 python-for-android google 小组的问题,这些小组对 _imaging.so 错误有相同的问题。响应似乎是没有引起问题。我删除了我的应用程序中的所有内容,除了画一个圆圈(有效)然后添加 ws4py 导入(这会破坏一切)。
除了将第三方库添加到规范文件之外,我还有什么遗漏的吗?在 Ubuntu 中运行时一切正常。任何帮助将不胜感激,因为我的应用程序依赖于 Web 套接字连接到我的后端。