Android 使用buildozer构建apk文件中的bcrypt

Android 使用buildozer构建apk文件中的bcrypt,android,python-3.x,kivy,bcrypt,buildozer,Android,Python 3.x,Kivy,Bcrypt,Buildozer,当我将bcrypt添加到buildozer.spec文件中的需求时,buildozer不会构建项目。 如果没有bcrypt,项目将正常构建。如何添加bcrypt以使项目成功? 如果没有bcrypt,手机上的应用程序在启动后立即崩溃 Python版本3.6.9 生成错误日志: [INFO]: -> running python3 setup.py clean --all [INFO]: -> running python3 setup.py build_ext -v

当我将bcrypt添加到buildozer.spec文件中的需求时,buildozer不会构建项目。 如果没有bcrypt,项目将正常构建。如何添加bcrypt以使项目成功? 如果没有bcrypt,手机上的应用程序在启动后立即崩溃

Python版本3.6.9

生成错误日志:

[INFO]:    -> running python3 setup.py clean --all
[INFO]:    -> running python3 setup.py build_ext -v                            
Exception in thread background thread for pid 8389:                            
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
running build_ext
building '_cffi_backend' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/c
/home/skullage/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/home/skullage/.buildozer/android/platform/android-ndk-r19b/sysroot/usr/include/arm-linux-androideabi -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/include/python3.8 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:4197:31: warning: assigning to 'char *' from 'const char *'
      discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        *p_printable_filename = PyText_AsUTF8(s);
                              ^ ~~~~~~~~~~~~~~~~
c/_cffi_backend.c:5911:9: warning: 'ffi_prep_closure' is deprecated
      [-Wdeprecated-declarations]
    if (ffi_prep_closure(closure, &cif_descr->cif,
        ^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include/ffi.h:339:18: note: 
      'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))
                 ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
    builtins = tstate->interp->builtins;
               ~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: 
      forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
    new1 = PyThreadState_GET()->interp->modules;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: 
      forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
        if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: 
      forward declaration of 'struct _is'
struct _is;
       ^
2 warnings and 3 errors generated.
error: command '/home/skullage/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1
  STDERR:
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1199, in <module>
    main()
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 671, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 155, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 209, in build_dist_from_args
    args, "ignore_setup_py", False
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 580, in build_recipes
    recipe.build_arch(arch)
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1009, in build_arch
    self.build_compiled_components(arch)
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1021, in build_compiled_components
    _env=env, *self.setup_extra_args)
  File "/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 180, in shprint
    for line in output:
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 863, in next
    self.wait()
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 
  RAN: /home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v
  STDOUT:
running build_ext
building '_cffi_backend' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/c
/home/skullage/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/home/skullage/.buildozer/android/platform/android-ndk-r19b/sysroot/usr/include/arm-linux-androideabi -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/include/python3.8 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:4197:31: warning: assigning to 'char *' from 'const char *'
      discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        *p_printable_filename = PyText_AsUTF8(s);
                              ^ ~~~~~~~~~~~~~~~~
c/_cffi_backend.c:5911:9: warning: 'ffi_prep_closure' is deprecated
      [-Wdeprecated-declarations]
    if (ffi_prep_closure(closure, &cif_descr->cif,
        ^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include/ffi.h:339:18: note: 
      'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))
                 ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
    builtins = tstate->interp->builtins;
               ~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: 
      forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
    new1 = PyThreadState_GET()->interp->modules;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: 
      forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
        if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: 
      forward declaration of 'struct _is'
struct _is;
       ^
2 warnings and 3 errors generated.
error: command '/home/skullage/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1
  STDERR:
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy,sqlite3,bcrypt --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
[INFO]:->运行python3 setup.py clean--all
[信息]:->正在运行python3 setup.py build\u ext-v
pid 8389的线程背景线程中出现异常:
回溯(最近一次呼叫最后一次):
文件“/usr/lib/python3.6/threading.py”,第916行,在内部引导中
self.run()
文件“/usr/lib/python3.6/threading.py”,第864行,运行中
自我目标(*自我参数,**自我参数)
文件“/usr/local/lib/python3.6/dist packages/sh-1.12.14-py3.6.egg/sh.py”,第1540行,换行
fn(*args,**kwargs)
文件“/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py”,第2459行,位于后台线程中
句柄退出代码(退出代码)
fn中的文件“/usr/local/lib/python3.6/dist packages/sh-1.12.14-py3.6.egg/sh.py”,第2157行
返回self.command.handle\u命令\u退出代码(退出代码)
文件“/usr/local/lib/python3.6/dist packages/sh-1.12.14-py3.6.egg/sh.py”,第815行,在handle_命令_exit_代码中
加薪
sh.ErrorReturnCode_1:
RAN:/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/hostpython3/desktop/hostpython3/native build/python3 setup.py build\u ext-v
标准:
运行build_ext
正在生成“\u cffi\u后端”扩展
创建构建
创建build/temp.linux-x86_64-3.8
创建build/temp.linux-x86_64-3.8/c
/home/skullage/.buildozer/android/platform/android-ndk-r19b/toolschains/llvm/prebuilded/linux-x86_64/bin/clang-target armv7a-linux-androideabi21-fomit框架指针-march=armv7-a-mfloat abi=softfp-mfpu=vfpp-mthumb-fPIC-Wno未使用结果-Wsign比较-DNDEBUG-g-fwrapv-O3-Wall-target armv7a-linux-androideabi21-fomit框架指针-march=armv7-a-mfloat-abi=softfp-mfpu=vfp-mthumb-fPIC-I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a_undk_target\u 21/libffi/Include-I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/python3/armeabi-v7a\u ndk\u target\u 21/python3/Include-DANDROID-D\u android\u API\u=21-I/home/skullage/.buildozer/android/platform/android/android-ndk-r19b/sysroot/usr/Include/arm-linux-I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/python安装/myapp/Include/python3.8-fPIC-DUSE\uu线程-DHAVE\u SYNC\u同步-I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u构建/hostpython3/hostpython3/Include-I/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/hostpython3/desktop/hostpython3/native build-c/\u cffi\u backend.c-o build/temp.linux-x86\u 64-3.8/c/\u cffi\u backend.o
c/_cffi_backend.c:4197:31:警告:从“const char*”分配到“char*”
丢弃限定符[-Wincompatible指针类型丢弃限定符]
*p_可打印文件名=PyText_AsUTF8;
^ ~~~~~~~~~~~~~~~~
c/\u cffi\u backend.c:5911:9:警告:不推荐使用“ffi\u prep\u closure”
[-Wdeprecated声明]
如果(外国金融机构准备)关闭(关闭和到岸价描述->到岸价,
^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/libffi/armeabi-v7a\u\u ndk\u target\u 21/libffi/Include/ffi.h:339:18:注:
“ffi_准备_闭包”已在此处明确标记为不推荐
__属性_uuu((不推荐))
^
在c/_cffi_backend.c:7370中包含的文件中:
在c/cffi1_module.c:20中包含的文件中:
c/call_python.c:20:30:错误:类型“struct\u is”的定义不完整
内置=t状态->内部->内置;
~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/python3/armeabi-v7a\uu\u ndk\u target\u 21/python3/Include/pystate.h:20:8:注:
“struct\u is”的转发声明
结构是;
^
在c/_cffi_backend.c:7370中包含的文件中:
在c/cffi1_module.c:20中包含的文件中:
c/call_python.c:160:39:错误:类型“struct\u is”的定义不完整
new1=PyThreadState_GET()->interp->modules;
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/python3/armeabi-v7a\uu\u ndk\u target\u 21/python3/Include/pystate.h:20:8:注:
“struct\u is”的转发声明
结构是;
^
在c/_cffi_backend.c:7370中包含的文件中:
在c/cffi1_module.c:20中包含的文件中:
c/call_python.c:249:63:错误:类型“struct\u is”的定义不完整
if(externpy->reserved1!=PyThreadState\u GET()->interp->modules){
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/build-armeabi-v7a/build/other\u builds/python3/armeabi-v7a\uu\u ndk\u target\u 21/python3/Include/pystate.h:20:8:注:
“struct\u is”的转发声明
结构是;
^
生成2个警告和3个错误。
错误:命令“/home/skullage/.buildozer/android/platform/android-ndk-r19b/toolschains/llvm/prebuild/linux-x86_64/bin/clang”失败,退出状态为1
标准:
回溯(最近一次呼叫最后一次):
文件“/usr/lib/python3.6/runpy.py”,第193行,在“运行”模块中作为“主”
“\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
文件“/usr/lib/python3.6/runpy.py”,第85行,在运行代码中
exec(代码、运行\全局)
文件“/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python for android/pythonfordroid/toolchain.py”,第1199行,在
main()
文件“/home/skullage/Mobile4/venv/Include/.buildozer/android/platform/python for android/pythonfordroid/entrypoints.py”,林