我正在尝试使用buildozer(python-for-android)构建一个Android应用程序。该应用程序使用OpenCV进行图像处理,就像Ubuntu 14.01 LTS和Windows 7和8.1上的魅力一样。
使用buildozer的构建过程运行良好,我可以在Android设备上部署应用程序,但是当我尝试在设备上启动应用程序时应用程序崩溃。
这是我用adb logcat获得的跟踪:
I/python ( 9066): Initialize Python for Android
I/python ( 9066): Android kivy bootstrap done. __name__ is __main__
I/python ( 9066): Run user program, change dir and execute main.py
I/python ( 9066): [WARNING ] [Config ] Older configuration version detected (0 instead of 13)
I/python ( 9066): [WARNING ] [Config ] Upgrading configuration in progress.
I/python ( 9066): [INFO ] [Kivy ] v1.9.0
I/python ( 9066): [INFO ] [Python ] v2.7.2 (default, Sep 23 2015, 14:05:23)
I/python ( 9066): [GCC 4.8]
I/python ( 9066): [INFO ] [Factory ] 173 symbols loaded
I/python ( 9066): [INFO ] [ImageLoaderFFPy] Using ffpyplayer 3.2-dev
I/python ( 9066): [INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame, img_ffpyplayer (img_pil ignored)
I/python ( 9066): [INFO ] [VideoFFPy ] Using ffpyplayer 3.2-dev
I/python ( 9066): [INFO ] [Video ] Provider: ffpyplayer(['video_pygst', 'video_ffmpeg'] ignored)
I/python ( 9066): [INFO ] [Text ] Provider: pygame
I/python ( 9066): [INFO ] [Window ] Provider: pygame
I/libSDL ( 9066): SDL_SetVideoMode(): application requested mode 1280x800
I/python ( 9066): [INFO ] [GL ] OpenGL version <OpenGL ES 3.0 V@84.0 AU@ (CL@)>
I/python ( 9066): [INFO ] [GL ] OpenGL vendor <Qualcomm>
I/python ( 9066): [INFO ] [GL ] OpenGL renderer <Adreno (TM) 305>
I/python ( 9066): [INFO ] [GL ] OpenGL parsed version: 3, 0
I/python ( 9066): [INFO ] [GL ] Texture max size <4096>
I/python ( 9066): [INFO ] [GL ] Texture max units <16>
I/python ( 9066): [INFO ] [Shader ] program: <--From Vertex Shader:
I/python ( 9066): --From Fragment Shader:
I/python ( 9066): Link was successful.>
I/python ( 9066): [INFO ] [Support ] Android install hooks
I/python ( 9066): [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
I/python ( 9066): ImportError: numpy.core.multiarray failed to import
I/python ( 9066): Traceback (most recent call last):
I/python ( 9066): File "/home/florian/camtest/takepicture/android/.buildozer/android/app/main.py", line 27, in <module>
I/python ( 9066): ImportError: numpy.core.multiarray failed to import
I/python ( 9066): Python for android ended.
崩溃的python行是导入opencv的时候:
import cv2
使用的OpenCV版本是2.4.11(我还通过修改python-for-android的recipes文件夹中的recipe.sh文件尝试了2.4.9和2.4.10)
使用的Numpy版本是1.9.2(我也试过1.7.1和1.9.3没有运气)
老实说,我不知道该怎么做,所以任何帮助都会非常感激。