在Ubuntu 12.04上使用Kivy和Buildozer制作apk
我在用buildozer制作我的简单kivy模块的APK时遇到了问题。
下面是错误信息:
Entering in ARM enviromnent Compiler found at /home/roshan/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin//arm-linux-androideabi-gcc /home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running build_ext building 'jnius' extension arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-i686-2.7/jnius/jnius.o jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation. #error Do not use this file, it is the result of a failed Cython compilation. ^ error: command 'arm-linux-androideabi-gcc' failed with exit status 1 Compiling /home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/pyjnius/pyjnius-master/jnius/jnius.pyx Error compiling Cython file: ------------------------------------------------------------ ... cdef class ByteArray: cdef LocalRef _jobject cdef long _size cdef jbyte *_buf cdef jbyte[:] _arr ^ ------------------------------------------------------------ jnius/jnius_nativetypes.pxi:19:15: Expected an identifier or literal /home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running build_ext building 'jnius' extension arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-i686-2.7/jnius/jnius.o jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation. #error Do not use this file, it is the result of a failed Cython compilation. ^ error: command 'arm-linux-androideabi-gcc' failed with exit status 1 # Command failed: ./distribute.sh -m "kivy" -d "Playstring"
怎么解决这个问题呢?我尝试重新安装cython,但没有用。
1 个回答
2
看起来你的Cython版本太旧了。我在12.04开始做Kivy开发的时候也遇到过类似的问题。你可以试着从PPA安装一个更新的版本,或者用PIP来安装。
从PPA安装:
sudo apt-add-repository ppa:cython-dev/master-ppa
sudo apt-get update
sudo apt-get install cython
使用PIP安装:
sudo apt-get install python-pip
sudo pip install --upgrade cython