我试图用buildozer构建最基本的Hello World kivy apk,它一直无法构建。我试过在两台不同的机器上运行Python 3.10.4的Solus,我确信我有所有的依赖关系,我一直得到同样的错误:
[DEBUG]: -> running rm -rf /home/solus/testapp/helloworld/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/android-sdl2/armeabi-v7a__ndk_target_21/android
[DEBUG]: -> running cp -a /home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/android/src /home/solus/testapp/helloworld/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/android-sdl2/armeabi-v7a__ndk_target_21/android
Exception in thread background thread for pid 54952:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 1683, in wrap
fn(*rgs, **kwargs)
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 2662, in background_thread
handle_exit_code(exit_code)
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 2349, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.SignalException_SIGSEGV:
RAN: /bin/cp -a /home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/android/src /home/solus/testapp/helloworld/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/android-sdl2/armeabi-v7a__ndk_target_21/android
STDOUT:
STDERR:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1294, in <module>
main()
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 728, in __init__
getattr(self, command)(args)
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 210, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 582, in build_recipes
recipe.prepare_build_dir(arch.arch)
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 753, in prepare_build_dir
shprint(sh.cp, '-a', join(self.get_recipe_dir(), self.src_filename),
File "/home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
for line in output:
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 953, in next
self.wait()
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 879, in wait
self.handle_command_exit_code(exit_code)
File "/home/solus/env/lib/python3.10/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.SignalException_SIGSEGV:
RAN: /bin/cp -a /home/solus/testapp/helloworld/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/android/src /home/solus/testapp/helloworld/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/android-sdl2/armeabi-v7a__ndk_target_21/android
STDOUT:
STDERR:
# Command failed: /home/solus/env/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch arm64-v8a --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/solus/testapp/helloworld/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug
# ENVIRONMENT:
# SHELL = '/bin/bash'
# SESSION_MANAGER = 'local/lenovo710s:@/tmp/.ICE-unix/1022,unix/lenovo710s:/tmp/.ICE-unix/1022'
# WINDOWID = '75497479'
# COLORTERM = 'truecolor'
# XDG_CONFIG_DIRS = '/usr/share/xdg:/etc/xdg:/usr/share'
# XDG_SESSION_PATH = '/org/freedesktop/DisplayManager/Session0'
# GNOME_KEYRING_CONTROL = '/home/solus/.cache/keyring-2DHCO1'
# HISTSIZE = '5000'
# LANGUAGE = ''
# SSH_AUTH_SOCK = '/tmp/ssh-XXXXXXkYS6ec/agent.939'
# SHELL_SESSION_ID = '736e5be83e8f41ccb3bf3b8c37bddf9d'
# DESKTOP_SESSION = 'plasma'
# SSH_AGENT_PID = '940'
# GTK_RC_FILES = '/etc/gtk/gtkrc:/home/solus/.gtkrc:/home/solus/.config/gtkrc'
# XCURSOR_SIZE = '24'
# GTK_MODULES = ':appmenu-gtk-module:appmenu-gtk-module:appmenu-gtk-module'
# XDG_SEAT = 'seat0'
# PWD = '/home/solus/testapp/helloworld'
# XDG_SESSION_DESKTOP = 'plasma'
# LOGNAME = 'solus'
# XDG_SESSION_TYPE = 'x11'
# SYSTEMD_EXEC_PID = '892'
# XAUTHORITY = '/home/solus/.Xauthority'
# XDG_GREETER_DATA_DIR = '/var/lib/lightdm-data/solus'
# GDM_LANG = 'en_IE.utf8'
# GTK2_RC_FILES = '/etc/gtk-2.0/gtkrc:/home/solus/.gtkrc-2.0:/home/solus/.config/gtkrc-2.0'
# HOME = '/home/solus'
# SSH_ASKPASS = '/usr/bin/ksshaskpass'
# LANG = 'en_IE.utf8'
# XDG_CURRENT_DESKTOP = 'KDE'
# KONSOLE_DBUS_SERVICE = ':1.77'
# VIRTUAL_ENV = '/home/solus/env'
# KONSOLE_DBUS_SESSION = '/Sessions/1'
# PROFILEHOME = ''
# XDG_SEAT_PATH = '/org/freedesktop/DisplayManager/Seat0'
# KONSOLE_VERSION = '220401'
# KDE_SESSION_UID = '1000'
# XDG_SESSION_CLASS = 'user'
# TERM = 'xterm-256color'
# USER = 'solus'
# COLORFGBG = '15;0'
# KDE_SESSION_VERSION = '5'
# PAM_KWALLET5_LOGIN = '/tmp/kwallet5_solus.socket'
# DISPLAY = ':0'
# SHLVL = '1'
# INPUTRC = '/etc/inputrc'
# XDG_VTNR = '7'
# XDG_SESSION_ID = '1'
# VIRTUAL_ENV_PROMPT = '(env) '
# LD_LIBRARY_PATH = ':/usr/local/lib'
# XDG_RUNTIME_DIR = '/run/user/1000'
# PS1 = ('(env) \[\033[38;5;081m\]\u\[\033[38;5;245m\]@\[\033[38;5;206m\]\H '
'\[\033[38;5;245m\]\w \[\033[38;5;081m\]$ \[\e[0m\]')
# QT_AUTO_SCREEN_SCALE_FACTOR = '0'
# XCURSOR_THEME = 'breeze_cursors'
# XDG_DATA_DIRS = '/home/solus/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/share:/var/lib/snapd/desktop/:/var/lib/snapd/desktop'
# KDE_FULL_SESSION = 'true'
# PATH = '/home/solus/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/solus/env/bin:/home/solus/.local/bin:/home/solus/bin:/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin'
# HISTIGNORE = '&:[bf]g:exit'
# GDMSESSION = 'plasma'
# HISTFILESIZE = '5000'
# DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
# KDE_APPLICATIONS_AS_SCOPE = '1'
# OLDPWD = '/home/solus/Dropbox/Stuff/HeroQuest/AHQ'
# KONSOLE_DBUS_WINDOW = '/Windows/1'
# _ = '/home/solus/env/bin/buildozer'
# PACKAGES_PATH = '/home/solus/.buildozer/android/packages'
# ANDROIDSDK = '/home/solus/.buildozer/android/platform/android-sdk'
# ANDROIDNDK = '/home/solus/.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
似乎是线程问题?我尝试了最近的ndk,但得到同样的错误。如有任何指导,我将不胜感激。
好的,我认为解决了它,我使用的是一个旧的教程kivy没有if __name__ in main
在它,它仍然不编译,因为现在它不能安装Cython,即使Cython安装在虚拟环境,但这是一个不同的问题。
我已经纠结了好几天了,一贴出来我就解决了....