Python 在buildozer中编译Cython文件时出错

Python 在buildozer中编译Cython文件时出错,python,cython,buildozer,cythonize,pyjnius,Python,Cython,Buildozer,Cythonize,Pyjnius,我使用kivy构建了一个android应用程序,当我使用buildozer编译它来构建apk时,出现了以下错误: [INFO]: -> directory context /home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius [INFO]: -> running python.host

我使用kivy构建了一个android应用程序,当我使用buildozer编译它来构建apk时,出现了以下错误:

[INFO]:    -> directory context /home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius
[INFO]:    -> running python.host -c import sys; print(sys.path)
           working: ['', '/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-instal[INFO]:    Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]:    -> running python.host setup.py build_ext -v
('cwd is', '/home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius')               
           working:  #error Do not use this file, it is the result of a failed Cython compilatiException in thread background thread for pid 3379:   
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2455, in background_thread
    handle_exit_code(exit_code)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2153, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
ErrorReturnCode_1: 

  RAN: /home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/bin/python.host setup.py build_ext -v

  STDOUT:
/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running build_ext
building 'jnius' extension
/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -I/home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -isysroot /home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/include/python2.7 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -I/home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -isysroot /home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/include/python2.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-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 '/usr/bin/ccache' failed with exit status 1


  STDERR:


[INFO]:    pyjnius first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize jnius/jnius.pyx
[INFO]:    -> running cython ./jnius/jnius.pyx
()                                                                                                                                                   
           working:             for interface in getattr(value, '__javainterfaces__', []):     Exception in thread background thread for pid 3389:   
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2455, in background_thread
    handle_exit_code(exit_code)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2153, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
ErrorReturnCode_1: 

  RAN: /usr/local/bin/cython ./jnius/jnius.pyx

  STDOUT:

Error compiling Cython file:
------------------------------------------------------------
...
            if jcs is not None:
                obj = jcs.j_cls

        if NULL == obj:
            for interface in getattr(value, '__javainterfaces__', []):
                obj = j_env[0].FindClass(j_env, str_for_c(interface))
                                                        ^
------------------------------------------------------------

jnius/jnius_export_class.pxi:133:57: Obtaining 'char *' from temporary Python value


  STDERR:


Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
    main()
  File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
    ToolchainCL()
  File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 149, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 193, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 573, in build_recipes
  File "pythonforandroid/recipe.py", line 928, in build_arch
  File "pythonforandroid/recipe.py", line 963, in build_cython_components
  File "pythonforandroid/recipe.py", line 1008, in cythonize_build
  File "pythonforandroid/recipe.py", line 999, in cythonize_file
  File "pythonforandroid/logger.py", line 175, in shprint
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 863, in next
    self.wait()
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/local/bin/cython ./jnius/jnius.pyx

  STDOUT:

Error compiling Cython file:
------------------------------------------------------------
...
            if jcs is not None:
                obj = jcs.j_cls

        if NULL == obj:
            for interface in getattr(value, '__javainterfaces__', []):
                obj = j_env[0].FindClass(j_env, str_for_c(interface))
                                                        ^
------------------------------------------------------------

jnius/jnius_export_class.pxi:133:57: Obtaining 'char *' from temporary Python value


  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/himanshu/helplineapp/.buildozer/android/platform/build
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
[INFO]:->目录context/home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius
[信息]:->运行python.host-c import sys;打印(系统路径)
工作:['',/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python instal[INFO]:尝试第一次构建pyjnius以获取cython文件:这可能会失败
[信息]:->运行python.host setup.py build_ext-v
('cwd is','/home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius')
工作:#错误请勿使用此文件,这是pid 3379的线程后台线程中Cython CompileatiException失败的结果:
回溯(最近一次呼叫最后一次):
文件“/usr/lib/python2.7/threading.py”,第801行,在引导程序内部
self.run()
文件“/usr/lib/python2.7/threading.py”,第754行,运行中
自我目标(*自我参数,**自我参数)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第1540行,换行
fn(*args,**kwargs)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第2455行,位于后台线程中
句柄退出代码(退出代码)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第2153行,fn
返回self.command.handle\u命令\u退出代码(退出代码)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第815行,在handle\u命令\u exit\u代码中
加薪
ErrorReturnCode_1:
RAN:/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python installs/myapp/bin/python.host setup.py build\u ext-v
标准:
/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python安装/myapp/lib/python2.7/distutils/dist.py:267:UserWarning:未知分发选项:“安装\u需要”
警告。警告(msg)
运行build_ext
构建“jnius”扩展
/usr/bin/ccache-arm-linux-androideabi-gcc-DANDROID-mandroid-fomit帧指针-D_u-ANDROID\u-API_u=19-I/home/himanshu/.buildozer/ANDROID/platform/ANDROID-ndk-r9c/platforms/ANDROID-19/arch-arm/.buildozer/ANDROID/platforms/platforms/ANDROID/platform/ANDROID-ndk-r9c/arm-I/home/himanshu/helplineapp/.buildozer/ANDROID/platform/build/build/python安装/myapp/include/python2.7-DNDEBUG-g-O3-Wall-Wstrict原型-DANDROID-mandroid-fomit框架指针-D_u-ANDROID\u-API_uu=19-I/home/himanshu/.buildozer/ANDROID/platform/ANDROID-ndk-r9c/platforms/ANDROID-19/arch arm-isysroot/home/himanshu/.buildozer/ANDROID/platform/ANDROID-ndk-r9c/platforms/arch arm-I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python安装/myapp/include/python2.7-march=armv7-a-mfloat abi=softfp-mfpu=vfp-mthumb-fPIC-vfp-vfp-mthumb-fPIC-I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/build/python/python安装/myapp/include/c/python2.7-c-jnius/jnius.c-o-build-linux-x86
jnius/jnius.c:1:2:error:#error不使用此文件,它是Cython编译失败的结果。
#错误:不要使用此文件,这是Cython编译失败的结果。
^
错误:命令“/usr/bin/ccache”失败,退出状态为1
标准:
[信息]:pyjnius首次构建失败(如预期)
[信息]:在适当的地方运行cython
[信息]:Cythonize jnius/jnius.pyx
[信息]:->运行cython./jnius/jnius.pyx
()                                                                                                                                                   
工作:对于getattr中的接口(值,'.'.'javainterfaces'.[]):pid 3389的线程背景线程中的异常:
回溯(最近一次呼叫最后一次):
文件“/usr/lib/python2.7/threading.py”,第801行,在引导程序内部
self.run()
文件“/usr/lib/python2.7/threading.py”,第754行,运行中
自我目标(*自我参数,**自我参数)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第1540行,换行
fn(*args,**kwargs)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第2455行,位于后台线程中
句柄退出代码(退出代码)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第2153行,fn
返回self.command.handle\u命令\u退出代码(退出代码)
文件“/home/himanshu/.local/lib/python2.7/site packages/sh.py”,第815行,在handle\u命令\u exit\u代码中
加薪
ErrorReturnCode_1:
RAN:/usr/local/bin/cython./jnius/jnius.pyx
标准:
编译Cython文件时出错:
------------------------------------------------------------
...
如果jcs不是无:
obj=jcs.j_cls
如果NULL==obj:
对于getattr中的接口(值,'.'.'javainterfaces'.[]):
obj=j_env[0]。FindClass(j_env,str_for_c(接口))
^
------------------------------------------------------------
jnius/jnius_export_class.pxi:133:57:从临时Python值获取“char*”
标准:
回溯(最近一次呼叫最后一次):
文件“/usr/lib/python2.7/runpy.py”,第174行,在运行模块中作为主模块
“\uuuuu main\uuuuuuuuuuuuuuuuuuuuuuuuu”,fname,loader,pkg\u name)
文件“/usr/lib/python2.7/runpy.py”,第72行,在运行代码中
run_globals中的exec代码
文件“/home/himanshu/helplineapp/.buildozer/android/platform/python for android new toolchain/pythonfordroid/toolchain.py”,第978行,在
main()
文件“/home/himanshu/helplineapp/.buildozer/android/platform/python for android new toolchain/pythonfordroid/toolchain.py”,第975行,主视图
工具链cl()
文件“/home/himanshu/helplineapp/.buildozer/android/platform/python for android new toolchain/pythonfordroid/toolchain.py”,第512行,在__
getattr(self,args.subparser_name.replace('-','''.'))(args)
文件“/主页/hima