如何阻止 Buildozer 在线下载食谱?

How to stop Buildozer from downloading recipes online?

在我开始使用 Buildozer v3.3 构建我的应用程序后,它总是崩溃,因为我没有 dist。因此它尝试在线下载食谱,但出于某种原因(这可能与我在 Ubuntu 64 位虚拟机上的事实有关)它从未实现过。有没有办法可以将其定向到 python-for-android 文件夹中的食谱或解决 sockets/handshakes?

的问题

我是 运行 Ubuntu 64 位 Virtual Box Windows 10 主机,我使用 Buildozer 0.33、Kivy 1.9.1 和 python-for-android-master 文件夹。下面是输出日志的主要部分。

[WARNING]: $ANDROIDNDKVER is deprecated and no longer necessary, the value you set is ignored
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI: 19
[WARNING]: Target API 19 < 26
[WARNING]: Target APIs lower than 26 are no longer supported on Google Play, and are not recommended. Note that the Target API can be higher than your device Android version, and should usually be as high as possible.
[INFO]:    Available Android APIs are (19)
[INFO]:    Requested API target 19 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/kivy/.buildozer/android/platform/android-ndk-r9c
[INFO]:    Could not determine NDK version, no source.properties in the NDK dir
[WARNING]: NDK API target was not set manually, using the default of 19 = min(android-api=19, default ndk-api=21)
[WARNING]: NDK API less than 21 is not supported
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.6', '4.8', 'clang3.3']
[INFO]:    Picking the latest gcc toolchain, here 4.8
[WARNING]: Missing executable: pkg-config is not installed
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Found multiple valid dependency orders:
[INFO]:        ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:        ['hostpython2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:        ['hostpython2legacy', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2legacy', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:        ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:    Using the first of these: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name camera and requirements (kivy)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:    Dist will also contain modules () installed from pip
[INFO]:    -> directory context /home/kivy/Downloads/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3
[INFO]:    <- directory context /home/kivy/Downloads/Camera/python-for-android-master
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', u'pyjnius', 'android', u'kivy']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /home/kivy/Downloads/...(and 61 more)
[INFO]:    -> directory context /home/kivy/Downloads/Camera/.buildozer/android/platform/build/packages/hostpython3
[INFO]:    -> running basename https://www.python.org...(and 34 more)
[INFO]:    -> running rm -f .mark-Python-3.7.1.tgz
[INFO]:    Downloading hostpython3 from https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
- Download 98.[INFO]:    -> running touch .mark-Python-3.7.1.tgz               
[INFO]:    <- directory context /home/kivy/Downloads/Camera/python-for-android-master
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /home/kivy/Downloads/...(and 56 more)
[INFO]:    -> directory context /home/kivy/Downloads/Camera/.buildozer/android/platform/build/packages/libffi
[INFO]:    -> running basename https://github.com/lib...(and 32 more)
                                                                  [INFO]:    -> running rm -f .mark-v3.2.1.tar.gz
[INFO]:    Downloading libffi from https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/kivy/Downloads/Camera/python-for-android-master/pythonforandroid/toolchain.py", line 1081, in <module>
    main()
  File "/home/kivy/Downloads/Camera/python-for-android-master/pythonforandroid/toolchain.py", line 1075, in main
    ToolchainCL()
  File "/home/kivy/Downloads/Camera/python-for-android-master/pythonforandroid/toolchain.py", line 577, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/kivy/Downloads/Camera/python-for-android-master/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/kivy/Downloads/Camera/python-for-android-master/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 540, in build_recipes
  File "pythonforandroid/recipe.py", line 297, in download_if_necessary
  File "pythonforandroid/recipe.py", line 343, in download
  File "pythonforandroid/recipe.py", line 158, in download_file
  File "/usr/lib/python2.7/urllib.py", line 240, in retrieve
    fp = self.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 208, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 437, in open_https
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 1013, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 864, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 826, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 1220, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "/usr/lib/python2.7/ssl.py", line 487, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 243, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 405, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [Errno 1] _ssl.c:510: error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000)
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=camera --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --local-recipes /home/kivy/Downloads/Camera/python-for-android-master/pythonforandroid/recipes --color=always --storage-dir=/home/kivy/Downloads/Camera/.buildozer/android/platform/build
# 
# 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

我已经解决了这个问题。

我需要做的就是将食谱的 URL 更改为 Ubuntu 实际可以访问的内容(基本上 github 上没有的内容),并且我确保我没有' 使用 libffi。比如我把kivyURL改成了

https://files.pythonhosted.org/packages/7d/8b/89d220b7f96dc2662b81319067f679b4cd73cda66f4aa850db5b6c6cfc7a/Kivy-1.10.1.tar.gz