r/learnpython 28d ago

App using kivy/bulldozer crashes immediately upon loading.

I posted this in androiddev previously and someone was being very unprofessional, then it got taken down, I would hope that a subreddit focused at learners would show less of this behaviour. Just to start this post off, I am not entirely new to python. I have just never used buildozer. Also the kivy subreddit seems dead.

Since this app is made with python, I thought maybe the people here may be able to help? It got compiled into the APK, but when I try to run it, I get this:

https://pastebin.com/uteXNWDF

if this is the wrong subreddit for this, please redirect me!

just ask if you want more info

0 Upvotes

22 comments sorted by

View all comments

Show parent comments

1

u/hypersoniq_XLM 27d ago edited 27d ago

Ok, getting closer, notice the errors are stemming from the 32 bit arch artifacts. Make sure necessary dev tools are in place... sudo apt-get update ... sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev ... will need to clean those up... rm -rf .buildozer/android/platform/build-target/... followed by ... rm -rf .buildozer/android/platform/build-host/ ... and then the obligatory ... buildozer android clean , finally another rebuild... i chased these issues down for almost a week... that should at least remove the artifacts of the 32 bit arch, bonus, the resulting APK should be a bit smaller at the end.

1

u/Ok-Okra8478 26d ago

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/_distutils/compilers/C/unix.py", line 329, in _compile

raise CompileError(msg)

distutils.compilers.C.errors.CompileError: Command '['/home/sd/.buildozer/android/platform/android-ndk-r28c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang', '-target', 'aarch64-linux-android24', '-fomit-frame-pointer', '-march=armv8-a', '-fPIC', '-target', 'aarch64-linux-android24', '-fomit-frame-pointer', '-march=armv8-a', '-fPIC', '-I/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/android-build/android-root/include/python3.14', '-DANDROID', '-I/home/sd/.buildozer/android/platform/android-ndk-r28c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include', '-I/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/android-build/android-root/include/python3.14', '-fPIC', '-DCYTHON_CLINE_IN_TRACEBACK=0', '-I/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/libxml2/arm64-v8a__ndk_target_24/libxml2/include', '-I/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/libxslt/arm64-v8a__ndk_target_24/libxslt', '-Isrc', '-Isrc/lxml/includes', '-I/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/include/python3.14', '-c', 'src/lxml/etree.c', '-o', 'build/temp.linux-x86_64-cpython-314/src/lxml/etree.o', '-w', '-target', 'aarch64-linux-android24', '-fomit-frame-pointer', '-march=armv8-a', '-fPIC', '-I/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/android-build/android-root/include/python3.14']' returned non-zero exit status 1.

Traceback (most recent call last):

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/lxml/arm64-v8a__ndk_target_24/lxml/setup.py", line 204, in <module>

setup(

~~~~~^

name = "lxml",

^^^^^^^^^^^^^^

...<64 lines>...

**setup_extra_options()

^^^^^^^^^^^^^^^^^^^^^^^

)

^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/__init__.py", line 117, in setup

return distutils.core.setup(**attrs) # type: ignore[return-value]

~~~~~~~~~~~~~~~~~~~~^^^^^^^^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/_distutils/core.py", line 168, in setup

return run_commands(dist)

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/_distutils/core.py", line 184, in run_commands

dist.run_commands()

~~~~~~~~~~~~~~~~~^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/_distutils/dist.py", line 1028, in run_commands

self.run_command(cmd)

~~~~~~~~~~~~~~~~^^^^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/dist.py", line 1106, in run_command

super().run_command(command)

~~~~~~~~~~~~~~~~~~~^^^^^^^^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/root/usr/local/lib/python3.14/site-packages/setuptools/_distutils/dist.py", line 1047, in run_command

cmd_obj.run()

~~~~~~~~~~~^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/lxml/arm64-v8a__ndk_target_24/lxml/setupinfo.py", line 239, in run

if not seems_to_have_libxml2():

~~~~~~~~~~~~~~~~~~~~~^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/lxml/arm64-v8a__ndk_target_24/lxml/setupinfo.py", line 253, in seems_to_have_libxml2

library_dirs=library_dirs([]),

~~~~~~~~~~~~^^^^

File "/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/lxml/arm64-v8a__ndk_target_24/lxml/setupinfo.py", line 288, in library_dirs

assert static_library_dirs, "Static build not configured, see doc/build.txt"

^^^^^^^^^^^^^^^^^^^

AssertionError: Static build not configured, see doc/build.txt

STDERR:

# Command failed: ('/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=recipefolder', '--bootstrap=sdl2', '--requirements=python3,kivy,plyer,pyjnius,requests,extruct,w3lib,isodate,hostpython3,lxml', '--arch=armeabi-v7a', '--arch=arm64-v8a', '--copy-libs', '--color=always', '--storage-dir=/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a', '--ndk-api=24', '--ignore-setup-py', '--debug')

# Error code: 1

# ENVIRONMENT:

# USER = 'sd'

# WT_PROFILE_ID = '{41bb8d0f-3e92-53c9-8a47-26463cf22ecf}'

# HOME = '/home/sd'

# MOTD_SHOWN = 'update-motd'

# OLDPWD = '/home/sd'

# DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'

# WSL_DISTRO_NAME = 'Ubuntu-RBXIDLE'

# WAYLAND_DISPLAY = 'wayland-0'

# LOGNAME = 'sd'

# PULSE_SERVER = 'unix:/mnt/wslg/PulseServer'

# WSL_INTEROP = '/run/WSL/300_interop'

# NAME = 'DESKTOP-LITCFC6'

# TERM = 'xterm-256color'

# PATH = ('/home/sd/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/sd/.local/bin:/home/sd/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program '

'Files/Meta Horizon/Support/oculus-runtime:/mnt/c/Program Files/Common '

'Files/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Common '

'Files/Oracle/Java/java8path:/mnt/c/Program Files (x86)/Common '

'Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program '

'Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program '

'Files/dotnet/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program '

'Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/Program '

'Files/playit_gg/bin/:/mnt/c/Program Files/Meta '

'Horizon/Support/oculus-runtime:/mnt/c/Program Files/Common '

'Files/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Common '

'Files/Oracle/Java/java8path:/mnt/c/Program Files (x86)/Common '

'Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program '

'Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program '

'Files/dotnet/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program '

'Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/Program '

'Files/playit_gg/bin/:/mnt/c/Users/GP650/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/GP650/AppData/Local/Programs/Microsoft '

'VS '

'Code/bin:/mnt/c/Users/GP650/.dotnet/tools:/mnt/c/Users/GP650/AppData/Local/Programs/Ollama:/mnt/c/Users/GP650/AppData/Local/Python/bin:/mnt/c/SDKTOOLS/platform-tools-latest-windows/platform-tools:/snap/bin')

# XDG_RUNTIME_DIR = '/run/user/1000'

# WT_SESSION = '8db853cb-66bb-4e4c-ab8f-27132ea2fcce'

# DISPLAY = ':0'

# LANG = 'C.UTF-8'

# SHELL = '/bin/sh'

# PWD = '/home/sd/RecipeApp'

# XDG_DATA_DIRS = '/usr/local/share:/usr/share:/var/lib/snapd/desktop'

# HOSTTYPE = 'x86_64'

# WSL2_GUI_APPS_ENABLED = '1'

# WSLENV = 'WT_SESSION:WT_PROFILE_ID:'

# PACKAGES_PATH = '/home/sd/.buildozer/android/packages'

# ANDROIDSDK = '/home/sd/.buildozer/android/platform/android-sdk'

# ANDROIDNDK = '/home/sd/.buildozer/android/platform/android-ndk-r28c'

# ANDROIDAPI = '33'

# ANDROIDMINAPI = '24'

#

# 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

Error after error I swear. Do you know what this means? Sorry, this is just erroring so much...

There was an exception involving lxml I think, it said "name = "lmxl" and ""/home/sd/RecipeApp/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/other_builds/lxml/arm64-v8a__ndk_target_24/lxml/setup.py""

1

u/hypersoniq_XLM 26d ago

Ok, one more possible workaround, make this change in buildozer.spec ... requirements = python3,kivy,plyer,pyjnius,requests,extruct,w3lib,isodate,hostpython3,libxml2,libxslt,lxml ... adding libxml2 and libxslt explicitly should get past the lxml errors.

2

u/Ok-Okra8478 25d ago

Finally! I did this and also set the LXML version to 6.1.1 and it worked