当我使用kivy-buildozer生成Android应用程序时,出现以下错误:
Exception in thread background thread for pid 1612:
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 "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py install -O2 --root=/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/python-installs/myapp --install-lib=.
STDOUT:
Traceback (most recent call last):
File "setup.py", line 11, in <module>
import setuptools
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/dist.py", line 36, in <module>
from setuptools import windows_support
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/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/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1192, in <module>
main()
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 668, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 206, in build_dist_from_args
args, "ignore_setup_py", False
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 577, in build_recipes
recipe.build_arch(arch)
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 844, in build_arch
self.install_python_package(arch)
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 863, in install_python_package
_env=hpenv, *self.setup_extra_args)
File "/home/winicios/estudos/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 180, in shprint
for line in output:
File "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 863, in next
self.wait()
File "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/home/winicios/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py install -O2 --root=/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/python-installs/myapp --install-lib=.
STDOUT:
Traceback (most recent call last):
File "setup.py", line 11, in <module>
import setuptools
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/dist.py", line 36, in <module>
from setuptools import windows_support
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/home/winicios/estudos/kivy/.buildozer/android/platform/build/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/winicios/estudos/kivy/.buildozer/android/platform/build" --ndk-api=21
#
# 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
我研究了解决方法,但没有发现与此错误相关的任何信息。