在Ubuntu 12.04上使用Kivy和Buildozer制作apk

时间:2014-05-09 20:15:48

标签: android python kivy

我无法用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 个答案:

答案 0 :(得分: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