rstdocument小部件的使用使得kivy在android上崩溃

最近我尝试了kivy,并且我试图将kivy源代码中的演示编译到我的android手机中。 但是一些演示没有奏效。 经过一些实验后,我发现小部件RstDocument使其崩溃。 代码是:

main.py:

from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.popup import Popup
from kivy.uix.rst import RstDocument


class Root(FloatLayout):
    pass


class editorApp(App):
    pass


if __name__ == '__main__':
    editorApp().run()

editor.kv:

Root:

    BoxLayout:
        orientation: 'vertical'
        BoxLayout:
            size_hint_y: None
            height: 30
            Button:
                text: 'Load'
            Button:
                text: 'Save'

        BoxLayout:
            RstDocument:

我通过编译android的python

./distribute -m "kivy"

也许我需要用其他软件包进行编译?

当我在android中运行我的程序时,DDMS输出名称为rsttry:

11-03 18:55:41.412: I/SmartCardBroadcastReceiver(25845): foundMatchingVendorPackage - Checking for org.demo.rsttry
11-03 18:55:42.652: W/WindowManager(632): Force clearing orientation change: Window{436dbba8 u0 org.demo.rsttry/org.renpy.android.PythonActivity}
11-03 18:55:42.812: I/WindowManager(632): Screen frozen for +2s157ms due to AppWindowToken{43156f10 token=Token{43385fb0 ActivityRecord{428a1668 u0 org.demo.rsttry/org.renpy.android.PythonActivity}}}
11-03 18:55:45.872: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_image.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_image.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_image.so 0x4225cee0, skipping init
11-03 18:55:45.872: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_ttf.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_ttf.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_ttf.so 0x4225cee0, skipping init
11-03 18:55:45.872: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_mixer.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_mixer.so 0x4225cee0
11-03 18:55:45.872: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_mixer.so 0x4225cee0, skipping init
11-03 18:55:45.872: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libpython2.7.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libpython2.7.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libpython2.7.so 0x4225cee0, skipping init
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libapplication.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libapplication.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libapplication.so 0x4225cee0, skipping init
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_main.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_main.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_main.so 0x4225cee0, skipping init
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_io.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): Added shared lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_io.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): No JNI_OnLoad found in /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_io.so 0x4225cee0, skipping init
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/unicodedata.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): Added shared lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/unicodedata.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): No JNI_OnLoad found in /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/unicodedata.so 0x4225cee0, skipping init
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsqlite3.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): Added shared lib /data/app-lib/org.demo.rsttry-1/libsqlite3.so 0x4225cee0
11-03 18:55:45.882: D/dalvikvm(25829): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsqlite3.so 0x4225cee0, skipping init
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_sqlite3.so 0x4225cee0
11-03 18:55:45.882: E/dalvikvm(25829): dlopen("/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_sqlite3.so") failed: dlopen failed: library "/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_sqlite3.so" not found
11-03 18:55:45.882: D/dalvikvm(25829): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_imaging.so 0x4225cee0
11-03 18:55:45.882: E/dalvikvm(25829): dlopen("/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_imaging.so") failed: dlopen failed: library "/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_imaging.so" not found
11-03 18:55:46.202: I/python(25829): ['/data/data/org.demo.rsttry/files/lib/python2.7/site-packages', '/data/data/org.demo.rsttry/files/lib/site-python']
11-03 18:55:46.202: I/python(25829): Android path ['/data/data/org.demo.rsttry/files/lib/python27.zip', '/data/data/org.demo.rsttry/files/lib/python2.7', '/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload', '/data/data/org.demo.rsttry/files/lib/python2.7/site-packages', '/storage/emulated/0/org.demo.rsttry']
11-03 18:55:46.472: I/python(25829): Error: [('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-16.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-16.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-16.png'"), ('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-32.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-32.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-32.png'"), ('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-256.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-256.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-256.png'"), ('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-24.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-24.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-24.png'"), ('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-64.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-64.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-64.png'"), ('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-128.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-128.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-128.png'"), ('/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo/kivy-icon-512.png', '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-512.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon/kivy-icon-512.png'"), '/data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/data/logo', '/storage/emulated/0/org.demo.rsttry/.kivy/icon', "[Errno 1] Operation not permitted: '/storage/emulated/0/org.demo.rsttry/.kivy/icon'"]
11-03 18:55:46.572: I/python(25829): [INFO              ] [Logger      ] Record log in /storage/emulated/0/org.demo.rsttry/.kivy/logs/kivy_14-11-03_0.txt
11-03 18:55:47.612: I/python(25829):  /data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
11-03 18:55:48.902: I/ActivityManager(632): Process org.demo.rsttry:python (pid 25829) (adj 0) has died.
11-03 18:55:48.902: W/ActivityManager(632): Force removing ActivityRecord{428a1668 u0 org.demo.rsttry/org.renpy.android.PythonActivity}: app died, no saved state
11-03 18:58:59.652: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl.so 0x4225d678
11-03 18:58:59.662: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl.so 0x4225d678
11-03 18:58:59.662: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_image.so 0x4225d678
11-03 18:58:59.662: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_image.so 0x4225d678
11-03 18:58:59.662: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_image.so 0x4225d678, skipping init
11-03 18:58:59.672: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_ttf.so 0x4225d678
11-03 18:58:59.672: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_ttf.so 0x4225d678
11-03 18:58:59.672: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_ttf.so 0x4225d678, skipping init
11-03 18:58:59.672: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_mixer.so 0x4225d678
11-03 18:58:59.692: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_mixer.so 0x4225d678
11-03 18:58:59.692: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_mixer.so 0x4225d678, skipping init
11-03 18:58:59.692: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libpython2.7.so 0x4225d678
11-03 18:58:59.712: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libpython2.7.so 0x4225d678
11-03 18:58:59.712: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libpython2.7.so 0x4225d678, skipping init
11-03 18:58:59.752: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libapplication.so 0x4225d678
11-03 18:58:59.752: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libapplication.so 0x4225d678
11-03 18:58:59.752: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libapplication.so 0x4225d678, skipping init
11-03 18:58:59.752: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsdl_main.so 0x4225d678
11-03 18:58:59.752: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libsdl_main.so 0x4225d678
11-03 18:58:59.752: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsdl_main.so 0x4225d678, skipping init
11-03 18:58:59.752: D/dalvikvm(26217): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_io.so 0x4225d678
11-03 18:58:59.762: D/dalvikvm(26217): Added shared lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_io.so 0x4225d678
11-03 18:58:59.762: D/dalvikvm(26217): No JNI_OnLoad found in /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_io.so 0x4225d678, skipping init
11-03 18:58:59.762: D/dalvikvm(26217): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/unicodedata.so 0x4225d678
11-03 18:58:59.762: D/dalvikvm(26217): Added shared lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/unicodedata.so 0x4225d678
11-03 18:58:59.762: D/dalvikvm(26217): No JNI_OnLoad found in /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/unicodedata.so 0x4225d678, skipping init
11-03 18:58:59.762: D/dalvikvm(26217): Trying to load lib /data/app-lib/org.demo.rsttry-1/libsqlite3.so 0x4225d678
11-03 18:58:59.772: D/dalvikvm(26217): Added shared lib /data/app-lib/org.demo.rsttry-1/libsqlite3.so 0x4225d678
11-03 18:58:59.772: D/dalvikvm(26217): No JNI_OnLoad found in /data/app-lib/org.demo.rsttry-1/libsqlite3.so 0x4225d678, skipping init
11-03 18:58:59.772: D/dalvikvm(26217): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_sqlite3.so 0x4225d678
11-03 18:58:59.772: E/dalvikvm(26217): dlopen("/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_sqlite3.so") failed: dlopen failed: library "/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_sqlite3.so" not found
11-03 18:58:59.772: D/dalvikvm(26217): Trying to load lib /data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_imaging.so 0x4225d678
11-03 18:58:59.782: E/dalvikvm(26217): dlopen("/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_imaging.so") failed: dlopen failed: library "/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload/_imaging.so" not found
11-03 18:58:59.952: I/WindowManager(632): Screen frozen for +681ms due to Window{43032700 u0 Starting org.demo.rsttry}
11-03 18:59:00.272: I/python(26217): ['/data/data/org.demo.rsttry/files/lib/python2.7/site-packages', '/data/data/org.demo.rsttry/files/lib/site-python']
11-03 18:59:00.272: I/python(26217): Android path ['/data/data/org.demo.rsttry/files/lib/python27.zip', '/data/data/org.demo.rsttry/files/lib/python2.7', '/data/data/org.demo.rsttry/files/lib/python2.7/lib-dynload', '/data/data/org.demo.rsttry/files/lib/python2.7/site-packages', '/storage/emulated/0/org.demo.rsttry']
11-03 18:59:00.692: I/python(26217): [INFO              ] [Logger      ] Record log in /storage/emulated/0/org.demo.rsttry/.kivy/logs/kivy_14-11-03_1.txt
11-03 18:59:01.772: I/python(26217):  /data/data/org.demo.rsttry/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
11-03 18:59:03.202: I/ActivityManager(632): Process org.demo.rsttry:python (pid 26217) (adj 0) has died.
11-03 18:59:03.212: W/ActivityManager(632): Force removing ActivityRecord{43138c20 u0 org.demo.rsttry/org.renpy.android.PythonActivity}: app died, no saved state

我的android版本是4.3,ANDROIDAPI = 18。 NDK版本是r10c。 我使用Ubuntu 14.04。

而且我不使用buildozer,因为它无法下载和安装构建工具(任何想法?错误消息是BUILD FAILED /home/paul/.buildozer/android/platform/android-sdk-21/tools/ant/build .xml:483:SDK没有安装任何构建工具,之前我发现“无法找到/home/paul/.buildozer/android/platform/android-sdk-21/build-tools的最新版本”

并回到原来的问题。 如果结果是我需要为某些库编译安卓android的python,那是什么? kivy不应该跟它一起来吗?

感谢帮助!


哈哈我正在回答自己的问题:-)我希望我的回答是正确的,这对其他人有用

ddms输出由“kivycatalog”过滤。 今天我重新审视它,看着完整的ddms输出,并发现错误:没有名为python的模块。 我不知道为什么它被过滤掉了。 (我现在不熟悉android开发,谢谢观看!)


我也有同样的问题,Docutils在我的情况下失踪了。 我在Buildozer.specs要求中添加docutils,问题已解决。

链接地址: http://www.djcxy.com/p/91167.html

上一篇: Use of rstdocument widget make kivy crash on android

下一篇: Send message from content script to another