如何阻止Buildozer在线下载配方?

时间:2019-04-08 19:43:35

标签: python virtualbox buildozer

使用Buildozer v3.3开始构建应用程序后,由于没有发行人,它总是崩溃。因此,它尝试在线下载配方,但由于某种原因(可能与我在Ubuntu 64位虚拟盒中有关),它始终无法实现。有什么办法可以将其定向到python-for-android文件夹中的配方,或者解决套接字/握手问题?

我正在Windows 10主机上运行Ubuntu 64位虚拟盒,并且使用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

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。

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

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