Use of rstdocument widget make kivy crash on android - 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.

Related

java.lang.UnsatisfiedLinkError: dlopen failed: libavcodec-57.so has unexpected e_machine: 40

I'm trying to use FFmpeg 3.1.3 in the Android app.
The 'libavcodec-57.so' is loaded in the main activity, as the following:
static {
LogUtil.e("DEVICE ARCH", System.getProperty("os.arch"));
System.loadLibrary("avutil-55");
System.loadLibrary("avcodec-57");
}
And the logcat gives me: (time is not important)
E/DEVICE ARCH: armv7l
D/dalvikvm: Trying to load lib /data/app-lib/<package_name>-1/libavutil-55.so 0x4d11fe10
D/houdini: [5955] Loading library(version: 4.1.1a_y.45536 RELEASE)... successfully.
D/dalvikvm: Added shared lib /data/app-lib/<package_name>-1/libavutil-55.so 0x4d11fe10
D/dalvikvm: No JNI_OnLoad found in /data/app-lib/<package_name>-1/libavutil-55.so 0x4d11fe10, skipping init
D/dalvikvm: Trying to load lib /data/app-lib/<package_name>-1/libavcodec-57.so 0x4d11fe10
D/houdini: [5955] Unsupported feature (ID:0x10600ccf).
D/houdini: [5955] Open Native Library /data/app-lib/<package_name>-1/libavcodec-57.so failed.
E/dalvikvm: Houdini dlopen("/data/app-lib/<package_name>-1/libavcodec-57.so") failed: Cannot load ARM library
W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lapp/Activity/MainActivity;
W/dalvikvm: Class init failed in newInstance call (Lapp/Activity/MainActivity;)
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4c810160)
W/TDLog: UncaughtException in Thread main
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app-lib/<package_name>-1/libavcodec-57.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at <package_name>.Activity.MainActivity.<clinit>(MainActivity.java:128)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2141)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
at dalvik.system.NativeStart.main(Native Method)
It says that the device's arch is ARM. The libavcodec-57.so is failed to load and the e_machine: 40 indicates the expected arch is also ARM (see the ELF header doc).
Besides, both libavutil-55.so and libavcodec-57.so are located in the same directory.
The solution is to load all of the needed libraries by libavcodec-57.so before loading it.
Execute readelf -d libavcodec-57.so | grep NEEDED will get which libraries it need:
0x00000001 (NEEDED) Shared library: [libswresample-2.so]
0x00000001 (NEEDED) Shared library: [libavutil-55.so]
0x00000001 (NEEDED) Shared library: [libx264-148.so]
0x00000001 (NEEDED) Shared library: [libfaac.so]
0x00000001 (NEEDED) Shared library: [libm.so]
0x00000001 (NEEDED) Shared library: [libz.so]
0x00000001 (NEEDED) Shared library: [libc.so]
Except the built-in libraries libm, libz and libc, all of the needed libraries should be loaded before libavcodec-57.so. So the Java code changes like this:
static {
System.loadLibrary("faac");
System.loadLibrary("x264-148");
System.loadLibrary("avutil-55");
System.loadLibrary("swresample-2"); // need x264 and avutil
System.loadLibrary("avcodec-57"); // need all of the above
}

Android - Failure [INSTALL_FAILED_INTERNAL_ERROR]

I'm having some problems trying to install APKs in a specific device. I have lots of devices and it hadn't happened so far (all of them, Radxa Rock Pro).
When I run pm install myApp I get
root#radxaPro:/ # pm install /sdcard/myApp.apk
pkg: /sdcard/myApp.apk
Failure [INSTALL_FAILED_INTERNAL_ERROR]
Logcat output:
06-02 13:02:33.032 I/AndroidRuntime( 4469): JNI options: '-Xjniopts:warnonly'
06-02 13:02:33.042 D/dalvikvm( 4469): Trying to load lib libjavacore.so 0x0
06-02 13:02:33.042 D/dalvikvm( 4469): Added shared lib libjavacore.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): Trying to load lib libnativehelper.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): Added shared lib libnativehelper.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
06-02 13:02:33.082 D/dalvikvm( 4469): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
06-02 13:02:33.232 E/memtrack( 4469): Couldn't load memtrack module (No such file or directory)
06-02 13:02:33.232 E/android.os.Debug( 4469): failed to load memtrack module: -2
06-02 13:02:33.282 D/AndroidRuntime( 4469): Calling main entry com.android.commands.pm.Pm
06-02 13:02:33.292 W/ActivityManager( 474): Unable to start service Intent { cmp=com.android.defcontainer/.DefaultContainerService } U=0: not found
06-02 13:02:33.292 E/PackageManager( 474): Failed to bind to media container service
I think the most important line is Unable to start service Intent { cmp=com.android.defcontainer/.DefaultContainerService } U=0: not found because a successful installation shows this (another device):
06-02 13:04:35.747: I/AndroidRuntime(1005): JNI options: '-Xjniopts:warnonly'
06-02 13:04:35.757: D/dalvikvm(1005): Trying to load lib libjavacore.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Added shared lib libjavacore.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Trying to load lib libnativehelper.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Added shared lib libnativehelper.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
06-02 13:04:35.797: D/dalvikvm(1005): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
06-02 13:04:35.927: E/memtrack(1005): Couldn't load memtrack module (No such file or directory)
06-02 13:04:35.927: E/android.os.Debug(1005): failed to load memtrack module: -2
06-02 13:04:35.977: D/AndroidRuntime(1005): Calling main entry com.android.commands.pm.Pm
06-02 13:04:35.987: I/ActivityManager(478): Start proc com.android.defcontainer for service com.android.defcontainer/.DefaultContainerService: pid=1016 uid=10001 gids={50001, 1028, 1015, 1023, 2001, 1035}
The DefaultContainerService.apk is located in /system/priv-app/ but I have been able to check that it is not actually installed in that device. If I try to install it, I get the same error.
Does anyone have an idea? Is the Android system corrupt?
Thanks in advance.

Android application is not launching due to emulator issue

I am trying to run my Android application but I'm getting this error:
05-26 17:06:30.362: D/AndroidRuntime(8981):
Calling main entry com.android.commands.pm.Pm
05-26 17:08:46.372: D/AndroidRuntime(9000): >>>>>>
AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-26 17:08:46.372: D/AndroidRuntime(9000): CheckJNI is OFF
05-26 17:08:46.372: D/dalvikvm(9000): Trying to load lib libjavacore.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000): Added shared lib libjavacore.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000):
Trying to load lib libnativehelper.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000):
Added shared lib libnativehelper.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000):
No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
05-26 17:08:46.442: D/dalvikvm(9000):
Note: class Landroid/app/ ActivityManagerNative ;
has 179 unimplemented (abstract) methods
05-26 17:08:46.522: E/memtrack(9000):
Couldn't load memtrack module (No such file or directory)
05-26 17:08:46.522: E/android.os.Debug(9000):
failed to load memtrack module: - 2
05-26 17:08:46.552: D/AndroidRuntime(9000):
Calling main entry com.android.commands.pm.Pm
What can be the issue?
i can suggest you something, kill adb ,restart eclips and run emullator again.
else go for new updates, go to help->check for updates. if found new updates install it.

Kivy crashes in Android on launch

When I start my Kivy app on my Android phone (Samsung GSIII) the splash screen appears then it crashes and returns to my previous screen. After trail and error I settled on the fact that my import of ws4py was causing the error.
I added ws4py to my buildozer.spec file under requirements requirements = kivy,ws4py, and it seems to download correctly while running $>buildozer android debug. Looking through the source code of ws4py and reading the docs, there are no imports other than modules in the standard lib so it doesn't seem to be a dependency issue (but maybe it is?).
The DDMS log is here:
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
I checked out a few questions on the kivy and python-for-android google groups of people who had the same question about the _imaging.so error. The response seemed to be that is not causing the issue. I stripped out everything in my app except drawing a circle (which works) and then adding the ws4py import (which breaks everything).
Is there something I am missing about adding third party libraries other than adding them to the spec file? Everything works fine when running in Ubuntu. Any help would be greatly appreciated because my app is dependent on web sockets to connect to my backend.
Having the same problem. Adding openssl to the list of required modules fixed the issue (i.e. 'requirements = openssl, ws4py, kivy' in buildozer.spec).
It helped to use snakefood to list the each of the modules loaded by a python script. See list python package dependencies without loading them? for more details.
Have you enabled the INTERNET Android permission?
Also, ws4py has a lot of dependencies you might have to add. I can see problems especially with tornado, gevent, and cython. https://github.com/Lawouach/WebSocket-for-Python/blob/master/requirements/py2kreqs.txt

libs suddenly won't load in dynamic linker (NDK)

I've been developing an NDK app for quite some time and it's been working well. However, today the app randomly decided to not start anymore, after I compiled it after making some nominal change. It's caused by a cryptic problem with loading the app's main library. Here's some log output:
08-11 18:38:11.220 D/dalvikvm( 1237): Added shared lib /mnt/asec/com.audia.rta-1/lib/libqtandroid.so 0x40513bd8
08-11 18:38:11.220 D/dalvikvm( 1237): No JNI_OnLoad found in /mnt/asec/com.audia.rta-1/lib/libqtandroid.so 0x40513bd8, skipping init
08-11 18:38:11.220 D/dalvikvm( 1237): Trying to load lib /mnt/asec/com.audia.rta-1/lib/librta.so 0x40513bd8
08-11 18:38:11.260 D/AndroidRuntime( 1237): Shutting down VM
08-11 18:38:11.260 W/dalvikvm( 1237): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-11 18:38:11.260 E/AndroidRuntime( 1237): FATAL EXCEPTION: main
08-11 18:38:11.260 E/AndroidRuntime( 1237): java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1311]: 67 cannot locate '_ZNSaIcEC1Ev'...
08-11 18:38:11.260 E/AndroidRuntime( 1237):
08-11 18:38:11.260 E/AndroidRuntime( 1237): at java.lang.Runtime.loadLibrary(Runtime.java:434)
08-11 18:38:11.260 E/AndroidRuntime( 1237): at java.lang.System.loadLibrary(System.java:554)
08-11 18:38:11.260 E/AndroidRuntime( 1237): at com.audia.rta.RTA.onCreate(RTA.java:139)
According to some Google results, _ZNSaIcEC1Ev is part of libstdc++. I've checked, and it gets linked in the build process, and g++ is being used for linking.
Oddly enough, reverting to an older apk of the app fixes the problem, but compiling an old revision and installing that doesn't fix the problem. Everything in my build system is checked into version control, and I've done several clean builds. All my builds were working today and then they just stopped working. I didn't upgrade or install anything; it happened while I was in the middle of testing new code. What happened?
Update: Building from a freshly checked out copy doesn't fix the problem.
Update 2: Is there any way I can track down the link to that symbol, maybe with objdump? Maybe this could provide some clues.
I ended up compiling everything with a fresh NDK install, and it worked. It's as if the old one was corrupted somehow, though I have no idea how.
It was also an upgrade from r5b to r6, so maybe it's related to the NDK version.

Categories

Resources