为啥会有错误 buildozer debug 和 sdl 2?

Posted

技术标签:

【中文标题】为啥会有错误 buildozer debug 和 sdl 2?【英文标题】:Why is there error buildozer debug and sdl 2?为什么会有错误 buildozer debug 和 sdl 2? 【发布时间】:2021-11-18 08:34:18 【问题描述】:

我正在尝试使用 buildozer 调试从 .py 创建一个 .apk,但加载 sdl2 图像时总是出错。 它工作过一次,现在它总是显示这个错误。下载地址无效。

.................................................. ......................................

[INFO]:    Downloading sdl2_image
[DEBUG]:   -> running mkdir -p /home/isi/Schreibtisch/Project/.buildozer/android/platform/build-armeabi-v7a/packages/sdl2_image
[INFO]:    -> directory context /home/isi/Schreibtisch/Project/.buildozer/android/platform/build-armeabi-v7a/packages/sdl2_image
[DEBUG]:   -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[DEBUG]:    SDL2_image-2.0.4.tar.gz
[DEBUG]:   Downloading sdl2_image from https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[DEBUG]:   -> running rm -f .mark-SDL2_image-2.0.4.tar.gz
[INFO]:    Downloading sdl2_image from https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1007, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 947, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1414, in connect
    super().connect()
  File "/usr/lib/python3.8/http/client.py", line 918, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1276, in <module>
    main()
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 725, in __init__
    getattr(self, command)(args)
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 558, in build_recipes
    recipe.download_if_necessary()
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 362, in download_if_necessary
    self.download()
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 412, in download
    self.download_file(self.versioned_url, filename)
  File "/home/isi/Schreibtisch/Project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 218, in download_file
    urlretrieve(url, target, report_hook)
  File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1397, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 101] Network is unreachable>
Download failed: <urlopen error [Errno 101] Network is unreachable>; retrying in 1 second(s)...Download failed: <urlopen error [Errno 101] Network is unreachable>; retrying in 2 second(s)...Download failed: <urlopen error [Errno 101] Network is unreachable>; retrying in 4 second(s)...Download failed: <urlopen error [Errno 101] Network is unreachable>; retrying in 8 second(s)...# 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/isi/Schreibtisch/Project/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug

如何下​​载 sdl2,或者 buildozer 有问题吗?

【问题讨论】:

【参考方案1】:

这可能有两个原因。您的网络连接太差或不稳定,或者 SDL 服务器已关闭。

在第一种情况下,尝试另一个网络。

在第二种情况下,确实没有什么可以做的。这种情况有时会发生。解决此问题的唯一方法是等待一段时间让 SDL 服务重新上线。

【讨论】:

谢谢!服务器现在再次启动,所以它现在可以工作了。

以上是关于为啥会有错误 buildozer debug 和 sdl 2?的主要内容,如果未能解决你的问题,请参考以下文章

Buildozer“命令'['ant','debug']'返回非零退出状态1”

Kivy Buildozer:.so lib 文件缺少调试符号

在linux下打包安卓app时,在提示符下输入命令:buildozer android debug,老是出错怎么解决?求大神指点

为啥 buildozer 显示 Error: Activity class org.test.myapp/org.renpy.android.PythonActivity 不存在

无法在 Google Colab 中使用 buildozer 构建我的应用 apk?

为啥DEBUG版本正确,Release版本错误