我在尝试使用 buildozer 和 kivy 构建应用程序时遇到了一些困难。我的应用程序有三个要求:请求、kivy 和日期时间。直接构建应用程序时,出现以下错误:
# Install distribute
# Run 'curl http://python-distribute.org/distribute_setup.py | venv/bin/python'
# Cwd /home/USER/python/ZugGit/ZugAppFahrt/.buildozer
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
# Install requirement requests in virtualenv
# Run 'pip install --download-cache=/home/USER/.buildozer/cache --target=/home/USER/python/ZugGit/ZugAppFahrt/.buildozer/applibs requests'
# Cwd /home/USER/python/ZugGit/ZugAppFahrt/.buildozer
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --download-cache
# Command failed: pip install --download-cache=/home/USER/.buildozer/cache --target=/home/USER/python/ZugGit/ZugAppFahrt/.buildozer/applibs requests
#
# 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
我读了很多,发现问题出在 --download-cache 命令中。
因此,我从 buildozer 文件夹中的init .py 文件中删除了这一部分,但现在出现以下错误:
# Cwd /home/USER/python/ZugGit/ZugAppFahrt/.buildozer
Directory '/home/USER/python/ZugGit/ZugAppFahrt/.buildozer/applibs' is not installable. File 'setup.py' not found.
# Command failed: pip install --target=/home/USER/.buildozer/cach/home/USER/python/ZugGit/ZugAppFahrt/.buildozer/applibs
我对此完全陌生,无法弄清楚问题所在。我该怎么做才能正确构建我的应用程序。如果我在没有 kivy 作为要求的情况下构建应用程序,则应用程序已构建,但由于缺少请求而在启动时崩溃。
任何帮助将非常感激。
编辑:问题是我通过删除“--download-cache”部分引入了一个空格。
但是我遇到了一个新问题。现在我收到以下错误:
BUILD FAILED
/home/USER/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:377: SDK Platform Tools component is missing. Please install it with the SDK Manager (tools/android)
Traceback (most recent call last):
File "build.py", line 517, in <module>
make_package(args)
File "build.py", line 365, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib64/python3.4/subprocess.py", line 561, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python3 build.py --name ZugFart --version 0.1 --package org.zugfart.fart --private "/home/USER/python/ZugGit/ZugAppFahrt/.buildozer/android/app" --sdk 19 --minsdk 9 --permission INTERNET --orientation portrait debug
有趣的是,我不知何故在 buildozer 中引入了一个新错误,因为我也无法在没有要求的情况下构建应用程序。