Kivy Buildozer Returns 在 setup.py 中出错,退出状态为 1

Kivy Buildozer Returns errored out with exit status 1 in setup.py

我正在使用 kivy 和 kivymd 制作一个 android 应用程序。所以我遵循了 buildozer 文档页面上的所有说明,但我遇到了一个错误。我用过的模块有kivy,kivymd,datetime,sqlite3(都是纯python写的或者有recipe)

我已经在 buildozer.spec 文件中输入了所有这些内容。

我是 运行 虚拟环境中的 buildozer,在 Ubuntu(20)

的最新版本上有 python 3.7

这是错误之前出现的内容:

[INFO]:    -> running python3 -m venv venv
[INFO]:    Upgrade pip to latest version
[INFO]:    -> running bash -c source venv/bin/activate && pip install -U pip
[INFO]:    Install Cython in case one of the modules needs it to build                                 
[INFO]:    -> running bash -c venv/bin/pip install Cython
[INFO]:    Creating a requirements.txt file for the Python modules                                     
[INFO]:    Installing Python modules with pip
[INFO]:    IF THIS FAILS, THE MODULES MAY NEED A RECIPE. A reason for this is often modules       compiling native code that is unaware of Android cross-compilation and does not work without additional changes / workarounds.
[INFO]:    -> running bash -c venv/bin/pip install -v --target '/home/guhan/...(and 146 more)
working: Removed build tracker: '/tmp/pip-req-tracker-e95kbahw'

这是之后的错误

Exception information:
Traceback (most recent call last):
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 216, in _main
   status = self.run(options, args)
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
   return func(self, options, args)
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 324, in run
   requirement_set = resolver.resolve(
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
   discovered_reqs.extend(self._resolve_one(requirement_set, req))
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one
   abstract_dist = self._get_abstract_dist_for(req_to_install)
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 340, in _get_abstract_dist_for
   abstract_dist = self.preparer.prepare_linked_requirement(req)
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement
   abstract_dist = _get_prepared_distribution(
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 91, in _get_prepared_distribution
   abstract_dist.prepare_distribution_metadata(finder, build_isolation)
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/distributions/sdist.py", line 40, in prepare_distribution_metadata
   self.req.prepare_metadata()
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 554, in prepare_metadata
   self.metadata_directory = self._generate_metadata()
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 529, in _generate_metadata
   return generate_metadata_legacy(
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 70, in generate_metadata
   call_subprocess(
 File "/home/guhan/Documents/Program-files/Remainder_App/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
   raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Removed ast from https://files.pythonhosted.org/packages/4b/fb/2b954d2a38c9a0ef1da6a46737a75b4dbf6f60e5dad0f267a4ec5ece20de/AST-0.0.2.tar.gz#sha256=dc5b79c6ba11aea72c59c791a0bc5ae483b4c18fec6f643002d6fae24361eba0 (from -r requirements.txt (line 1)) from build tracker '/tmp/pip-req-tracker-e95kbahw'
Removed build tracker: '/tmp/pip-req-tracker-e95kbahw'

同样的错误在日志中出现两次

datetime 是 python 附带的内置 python 模块。您无需在 buildozer.spec 文件的 requirements 中指定它。只需将其从要求中删除并重新运行 buildozer。