Buildozer 进程在为 android 调试时未能执行最后一个命令错误

Posted

技术标签:

【中文标题】Buildozer 进程在为 android 调试时未能执行最后一个命令错误【英文标题】:Buildozer process failed executing the last command error while debugging for android 【发布时间】:2021-12-06 00:46:37 【问题描述】:

我还使用套接字模块制作了一个简单的 kivy 应用程序。但是当我尝试使用 google collab 和 buildozer 将其转换为 android 应用程序时,我遇到了这种错误。


    ERROR: Could not find a version that satisfies the requirement socket (from versions: none)
    ERROR: No matching distribution found for socket


  STDERR:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=starstocksapp --bootstrap=sdl2 --requirements=python3,socket,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/content/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
# ENVIRONMENT:
#     CUDNN_VERSION = '8.0.5.39'
#     PYDEVD_USE_FRAME_EVAL = 'NO'
#     LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'
#     CLOUDSDK_PYTHON = 'python3'
#     LANG = 'en_US.UTF-8'
#     HOSTNAME = '047d4a118941'
#     OLDPWD = '/'
#     CLOUDSDK_CONFIG = '/content/.config'
#     NVIDIA_VISIBLE_DEVICES = 'all'
#     DATALAB_SETTINGS_OVERRIDES = '"kernelManagerProxyPort":6000,"kernelManagerProxyHost":"172.28.0.3","jupyterArgs":["--ip=\\"172.28.0.2\\""],"debugAdapterMultiplexerPath":"/usr/local/bin/dap_multiplexer","enableLsp":true'
#     ENV = '/root/.bashrc'
#     PAGER = 'cat'
#     NCCL_VERSION = '2.7.8'
#     TF_FORCE_GPU_ALLOW_GROWTH = 'true'
#     JPY_PARENT_PID = '53'
#     NO_GCE_CHECK = 'True'
#     PWD = '/content'
#     HOME = '/root'
#     LAST_FORCED_REBUILD = '20211007'
#     CLICOLOR = '1'
#     DEBIAN_FRONTEND = 'noninteractive'
#     LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'
#     GCE_METADATA_TIMEOUT = '0'
#     GLIBCPP_FORCE_NEW = '1'
#     TBE_CREDS_ADDR = '172.28.0.1:8008'
#     TERM = 'xterm-color'
#     SHELL = '/bin/bash'
#     GCS_READ_CACHE_BLOCK_SIZE_MB = '16'
#     PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'
#     MPLBACKEND = 'module://ipykernel.pylab.backend_inline'
#     CUDA_VERSION = '11.1.1'
#     NVIDIA_DRIVER_CAPABILITIES = 'compute,utility'
#     SHLVL = '1'
#     PYTHONPATH = '/env/python'
#     NVIDIA_REQUIRE_CUDA = ('cuda>=11.1 brand=tesla,driver>=418,driver<419 '
 'brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451')
#     COLAB_GPU = '0'
#     GLIBCXX_FORCE_NEW = '1'
#     PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin:/opt/bin'
#     LD_PRELOAD = '/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4'
#     GIT_PAGER = 'cat'
#     _ = '/usr/local/bin/buildozer'
#     PACKAGES_PATH = '/root/.buildozer/android/packages'
#     ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r19c'
#     ANDROIDAPI = '27'
#     ANDROIDMINAPI = '21'
# 
# 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

我不知道为什么这个错误不断出现。我在目录中有我的 main.py 并且我已检查安装所有模块。但仍然没有任何反应。

我认为套接字模块不包括在内,或者某些问题是由于我包含套接字模块。我已将套接字模块的名称写在规范文件中,也写在要包含的模块中。

提前致谢。

【问题讨论】:

Buildozer.spec 会很有帮助。请发布您的 buildozer.spec 请发布完整日志 我认为您不应该将套接字添加到需求中,因为您已经添加了python3(套接字在python3中)。 【参考方案1】:

您不必在 buildozer.spec 文件的要求中添加套接字,因为它们是 python 中的内置模块。因此,当您在需求中添加 python3 时,它们会自动添加。 有关更多信息,请参阅此帖子: Buildozer not using correct kivy version when packaging for android

【讨论】:

以上是关于Buildozer 进程在为 android 调试时未能执行最后一个命令错误的主要内容,如果未能解决你的问题,请参考以下文章

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

第一个 Kivy/Buildozer android 项目出错

没有这样的文件或目录 buildozer 调试运行

Kivy 相机代码无法在 android 设备上运行

Buildozer 未知命令/目标 android_old

无法在 Android 上播放音频(ffpyplayer) - buildozer