为什么在使用buildozer来构建kivy的apk时出现错误?

时间:2020-09-06 05:24:53

标签: android python-3.x kivy buildozer

我已经下载了此脚本并运行以安装所有内容。 https://github.com/zaemiel/kivy-buildozer-installer 我完成了所有步骤。但是最后它给出了错误。我应该如何成功构建? 我在WSL中使用Python 3.6.9。我阅读github问题页面仍然没有帮助。这里缺少什么吗?在youtube上也有人安装而没有任何错误。

此完整错误日志。

[INFO]:    -> directory context /home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools
[INFO]:    -> running python3 setup.py install -O2 --root=/home/mani/kivymd/.buildozer/andro...(and 73 more)
Exception in thread background thread for pid 9111:
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.14.0-py3.6.egg/sh.py", line 1633, in wrap
    fn(*rgs, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.14.0-py3.6.egg/sh.py", line 2557, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.14.0-py3.6.egg/sh.py", line 2261, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.14.0-py3.6.egg/sh.py", line 861, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py install -O2 --root=/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp --install-lib=.

  STDOUT:
Traceback (most recent call last):
  File "setup.py", line 11, in <module>
    import setuptools
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/__init__.py", line 20, in <module>
    from setuptools.dist import Distribution, Feature
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/dist.py", line 36, in <module>
    from setuptools import windows_support
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py", line 2, in <module>
    import ctypes
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'


  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/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1260, in <module>
    main()
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 709, in __init__
    getattr(self, command)(args)
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 154, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 216, in build_dist_from_args
    args, "ignore_setup_py", False
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 577, in build_recipes
    recipe.build_arch(arch)
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 946, in build_arch
    self.install_python_package(arch)
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 965, in install_python_package
    _env=hpenv, *self.setup_extra_args)
  File "/home/mani/kivymd/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/usr/local/lib/python3.6/dist-packages/sh-1.14.0-py3.6.egg/sh.py", line 907, in next
    self.wait()
  File "/usr/local/lib/python3.6/dist-packages/sh-1.14.0-py3.6.egg/sh.py", line 837, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.14.0-py3.6.egg/sh.py", line 861, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py install -O2 --root=/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp --install-lib=.

  STDOUT:
Traceback (most recent call last):
  File "setup.py", line 11, in <module>
    import setuptools
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/__init__.py", line 20, in <module>
    from setuptools.dist import Distribution, Feature
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/dist.py", line 36, in <module>
    from setuptools import windows_support
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py", line 2, in <module>
    import ctypes
  File "/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'


  STDERR:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/mani/kivymd/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21

0 个答案:

没有答案