Use of rstdocument widget make kivy crash on android
Recently I tried kivy, and I am trying to compile the demo in kivy source code to my android phone. But some demo didn't work. After some experiment I found the widget RstDocument make it crash. The code is:
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:
I compile the python for android by
./distribute -m "kivy"
Maybe I need to compile it with some other packages?
The DDMS output when I run my program in android, which name is 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
My android is version 4.3, with ANDROIDAPI=18. NDK version is r10c. I use ubuntu 14.04.
And I don't use buildozer because it can't download and install build tools(Any idea? The error message is BUILD FAILED /home/paul/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:483: SDK does not have any Build Tools installed. And before that I found "Unable to find the latest version for /home/paul/.buildozer/android/platform/android-sdk-21/build-tools"
And return to the original question. If the result is I need to compile python for android with some library, what's that? shouldn't kivy come with it?
Thanks for help!
Haha I'm answering the question from myself :-) I hope my answer is right and it's useful for others
The ddms output is filtered by "kivycatalog". Today I restudied it and looked at the full ddms output, and found error: no module named pygment. I don't know why it's filtered out. (I'm not familiar with android development now, thanks for viewing!)
i had also same problem, Docutils was missing in my case. i added docutils in Buildozer.specs requirement, problem Solved.
链接地址: http://www.djcxy.com/p/91168.html上一篇: 为android应用程序保存数据更新服务