Crash when compiling kivy app into apk ModuleNotFoundError: No module named 'tomli'
I'm using python3==3.9.12 and hostpython3==3.9.12 and i'm using Google Colab to Compile the app into apk
Crash log is attached Below
[INFO]: Building Pillow for arm64-v8a
[INFO]: PIL apparently isn't already in site-packages
[DEBUG]: -> running pip install build[virtualenv] pip --target /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages --python-version 3.9.12 --only-binary=:all: --upgrade
[DEBUG]: Collecting pip
[DEBUG]: Using cached pip-25.1.1-py3-none-any.whl.metadata (3.6 kB)
[DEBUG]: Collecting build[virtualenv]
[DEBUG]: Using cached build-1.2.2.post1-py3-none-any.whl.metadata (6.5 kB)
[DEBUG]: Collecting packaging>=19.1 (from build[virtualenv])
[DEBUG]: Using cached packaging-25.0-py3-none-any.whl.metadata (3.3 kB)
[DEBUG]: Collecting pyproject_hooks (from build[virtualenv])
[DEBUG]: Using cached pyproject_hooks-1.2.0-py3-none-any.whl.metadata (1.3 kB)
[DEBUG]: Collecting virtualenv>=20.0.35 (from build[virtualenv])
[DEBUG]: Using cached virtualenv-20.31.2-py3-none-any.whl.metadata (4.5 kB)
[DEBUG]: Collecting distlib<1,>=0.3.7 (from virtualenv>=20.0.35->build[virtualenv])
[DEBUG]: Using cached distlib-0.3.9-py2.py3-none-any.whl.metadata (5.2 kB)
[DEBUG]: Collecting filelock<4,>=3.12.2 (from virtualenv>=20.0.35->build[virtualenv])
[DEBUG]: Using cached filelock-3.18.0-py3-none-any.whl.metadata (2.9 kB)
[DEBUG]: Collecting platformdirs<5,>=3.9.1 (from virtualenv>=20.0.35->build[virtualenv])
[DEBUG]: Using cached platformdirs-4.3.8-py3-none-any.whl.metadata (12 kB)
[DEBUG]: Using cached pip-25.1.1-py3-none-any.whl (1.8 MB)
[DEBUG]: Using cached packaging-25.0-py3-none-any.whl (66 kB)
[DEBUG]: Using cached virtualenv-20.31.2-py3-none-any.whl (6.1 MB)
[DEBUG]: Using cached build-1.2.2.post1-py3-none-any.whl (22 kB)
[DEBUG]: Using cached pyproject_hooks-1.2.0-py3-none-any.whl (10 kB)
[DEBUG]: Using cached distlib-0.3.9-py2.py3-none-any.whl (468 kB)
[DEBUG]: Using cached filelock-3.18.0-py3-none-any.whl (16 kB)
[DEBUG]: Using cached platformdirs-4.3.8-py3-none-any.whl (18 kB)
[DEBUG]: Installing collected packages: distlib, pyproject_hooks, platformdirs, pip, packaging, filelock, virtualenv, build
[DEBUG]: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cublas-cu12==12.4.5.8; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cublas-cu12 12.5.3.2 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cuda-cupti-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cuda-cupti-cu12 12.5.82 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cuda-nvrtc-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cuda-nvrtc-cu12 12.5.82 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cuda-runtime-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cuda-runtime-cu12 12.5.82 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cudnn-cu12==9.1.0.70; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cudnn-cu12 9.3.0.75 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cufft-cu12==11.2.1.3; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cufft-cu12 11.2.3.61 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-curand-cu12==10.3.5.147; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-curand-cu12 10.3.6.82 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cusolver-cu12==11.6.1.9; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cusolver-cu12 11.6.3.83 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-cusparse-cu12==12.3.1.170; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cusparse-cu12 12.5.1.3 which is incompatible.
[DEBUG]: torch 2.6.0+cu124 requires nvidia-nvjitlink-cu12==12.4.127; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-nvjitlink-cu12 12.5.82 which is incompatible.
[DEBUG]: langchain-core 0.3.59 requires packaging<25,>=23.2, but you have packaging 25.0 which is incompatible.
[DEBUG]: Successfully installed build-1.2.2.post1 distlib-0.3.9 filelock-3.18.0 packaging-25.0 pip-25.1.1 platformdirs-4.3.8 pyproject_hooks-1.2.0 virtualenv-20.31.2
[DEBUG]: Create directory /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/arm64-v8a__ndk_target_21/Pillow/p4a_android_build
[DEBUG]: -> running cp /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/android-build/python3
[INFO]: -> directory context /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/arm64-v8a__ndk_target_21/Pillow
[DEBUG]: -> running python3 -m build --wheel --config-setting builddir=/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/arm64-v8a__ndk_target_21/Pillow/p4a_android_build
[DEBUG]: Traceback (most recent call last):
[DEBUG]: File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 188, in _run_module_as_main
[DEBUG]: mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
[DEBUG]: File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 147, in _get_module_details
[DEBUG]: return _get_module_details(pkg_main_name, error)
[DEBUG]: File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 111, in _get_module_details
[DEBUG]: import(pkg_name)
[DEBUG]: File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/build/init.py", line 7, in
RAN: /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/android-build/python3 -m build --wheel --config-setting builddir=/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/arm64-v8a__ndk_target_21/Pillow/p4a_android_build
STDOUT:
Traceback (most recent call last):
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 147, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/build/init.py", line 7, in
STDERR:
Traceback (most recent call last):
File "
RAN: /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/android-build/python3 -m build --wheel --config-setting builddir=/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/arm64-v8a__ndk_target_21/Pillow/p4a_android_build
STDOUT:
Traceback (most recent call last):
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 147, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/build/init.py", line 7, in
STDERR:
Command failed: ['/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=stream', '--bootstrap=sdl2', '--requirements=python3==3.9.12,hostpython3==3.9.12,kivy==2.2.1,kivymd==1.1.1,pillow,pygments,docutils,pypiwin32,requests,urllib3,charset_normalizer,certifi,idna,openssl,chardet,Cython,audiostream,android', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--copy-libs', '--color=always', '--storage-dir=/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']
ENVIRONMENT:
SHELL = '/bin/bash'
NV_LIBCUBLAS_VERSION = '12.5.3.2-1'
NVIDIA_VISIBLE_DEVICES = 'all'
COLAB_JUPYTER_TRANSPORT = 'ipc'
NV_NVML_DEV_VERSION = '12.5.82-1'
NV_CUDNN_PACKAGE_NAME = 'libcudnn9-cuda-12'
CGROUP_MEMORY_EVENTS = '/sys/fs/cgroup/memory.events /var/colab/cgroup/jupyter-children/memory.events'
NV_LIBNCCL_DEV_PACKAGE = 'libnccl-dev=2.22.3-1+cuda12.5'
NV_LIBNCCL_DEV_PACKAGE_VERSION = '2.22.3-1'
VM_GCE_METADATA_HOST = '169.254.169.253'
HOSTNAME = '8c515cd8a5ba'
LANGUAGE = 'en_US'
TBE_RUNTIME_ADDR = '172.28.0.1:8011'
COLAB_TPU_1VM = ''
GCE_METADATA_TIMEOUT = '3'
JAVA_HOME = '/usr/lib/jvm/java-17-openjdk-amd64'
NVIDIA_REQUIRE_CUDA = ('cuda>=12.5 brand=unknown,driver>=470,driver<471 '
'brand=grid,driver>=470,driver<471 brand=tesla,driver>=470,driver<471 ' 'brand=nvidia,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 ' 'brand=quadrortx,driver>=470,driver<471 ' 'brand=nvidiartx,driver>=470,driver<471 brand=vapps,driver>=470,driver<471 ' 'brand=vpc,driver>=470,driver<471 brand=vcs,driver>=470,driver<471 ' 'brand=vws,driver>=470,driver<471 brand=cloudgaming,driver>=470,driver<471 ' 'brand=unknown,driver>=535,driver<536 brand=grid,driver>=535,driver<536 ' 'brand=tesla,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 ' 'brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 ' 'brand=nvidiartx,driver>=535,driver<536 brand=vapps,driver>=535,driver<536 ' 'brand=vpc,driver>=535,driver<536 brand=vcs,driver>=535,driver<536 ' 'brand=vws,driver>=535,driver<536 brand=cloudgaming,driver>=535,driver<536 ' 'brand=unknown,driver>=550,driver<551 brand=grid,driver>=550,driver<551 ' 'brand=tesla,driver>=550,driver<551 brand=nvidia,driver>=550,driver<551 ' 'brand=quadro,driver>=550,driver<551 brand=quadrortx,driver>=550,driver<551 ' 'brand=nvidiartx,driver>=550,driver<551 brand=vapps,driver>=550,driver<551 ' 'brand=vpc,driver>=550,driver<551 brand=vcs,driver>=550,driver<551 ' 'brand=vws,driver>=550,driver<551 brand=cloudgaming,driver>=550,driver<551')
NV_LIBCUBLAS_DEV_PACKAGE = 'libcublas-dev-12-5=12.5.3.2-1'
NV_NVTX_VERSION = '12.5.82-1'
COLAB_JUPYTER_IP = '172.28.0.12'
NV_CUDA_CUDART_DEV_VERSION = '12.5.82-1'
NV_LIBCUSPARSE_VERSION = '12.5.1.3-1'
COLAB_LANGUAGE_SERVER_PROXY_ROOT_URL = 'http://172.28.0.1:8013/'
NV_LIBNPP_VERSION = '12.3.0.159-1'
NCCL_VERSION = '2.22.3-1'
KMP_LISTEN_PORT = '6000'
TF_FORCE_GPU_ALLOW_GROWTH = 'true'
ENV = '/root/.bashrc'
PWD = '/content'
TBE_EPHEM_CREDS_ADDR = '172.28.0.1:8009'
COLAB_LANGUAGE_SERVER_PROXY_REQUEST_TIMEOUT = '30s'
TBE_CREDS_ADDR = '172.28.0.1:8008'
NV_CUDNN_PACKAGE = 'libcudnn9-cuda-12=9.2.1.18-1'
NVIDIA_DRIVER_CAPABILITIES = 'compute,utility'
COLAB_JUPYTER_TOKEN = ''
LAST_FORCED_REBUILD = '20250424'
NV_NVPROF_DEV_PACKAGE = 'cuda-nvprof-12-5=12.5.82-1'
NV_LIBNPP_PACKAGE = 'libnpp-12-5=12.3.0.159-1'
NV_LIBNCCL_DEV_PACKAGE_NAME = 'libnccl-dev'
TCLLIBPATH = '/usr/share/tcltk/tcllib1.20'
NV_LIBCUBLAS_DEV_VERSION = '12.5.3.2-1'
COLAB_KERNEL_MANAGER_PROXY_HOST = '172.28.0.12'
NVIDIA_PRODUCT_NAME = 'CUDA'
UV_BUILD_CONSTRAINT = ''
NV_LIBCUBLAS_DEV_PACKAGE_NAME = 'libcublas-dev-12-5'
USE_AUTH_EPHEM = '1'
NV_CUDA_CUDART_VERSION = '12.5.82-1'
COLAB_WARMUP_DEFAULTS = '1'
HOME = '/root'
LANG = 'en_US.UTF-8'
CUDA_VERSION = '12.5.1'
CLOUDSDK_CONFIG = '/content/.config'
NV_LIBCUBLAS_PACKAGE = 'libcublas-12-5=12.5.3.2-1'
NV_CUDA_NSIGHT_COMPUTE_DEV_PACKAGE = 'cuda-nsight-compute-12-5=12.5.1-1'
UV_SYSTEM_PYTHON = 'true'
COLAB_RELEASE_TAG = 'release-colab_20250512-060057_RC00'
PYDEVD_USE_FRAME_EVAL = 'NO'
KMP_TARGET_PORT = '9000'
CLICOLOR = '1'
KMP_EXTRA_ARGS = ('--logtostderr --listen_host=172.28.0.12 --target_host=172.28.0.12 '
'--tunnel_background_save_url=https://colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/m-s-a6mmrmkl21tz ' '--tunnel_background_save_delay=10s ' '--tunnel_periodic_background_save_frequency=30m0s ' '--enable_output_coalescing=true --output_coalescing_required=true ')
UV_INSTALL_DIR = '/usr/local/bin'
NV_LIBNPP_DEV_PACKAGE = 'libnpp-dev-12-5=12.3.0.159-1'
COLAB_LANGUAGE_SERVER_PROXY_LSP_DIRS = '/datalab/web/pyright/typeshed-fallback/stdlib,/usr/local/lib/python3.10/dist-packages'
NV_LIBCUBLAS_PACKAGE_NAME = 'libcublas-12-5'
COLAB_KERNEL_MANAGER_PROXY_PORT = '6000'
CLOUDSDK_PYTHON = 'python3'
NV_LIBNPP_DEV_VERSION = '12.3.0.159-1'
ENABLE_DIRECTORYPREFETCHER = '1'
NO_GCE_CHECK = 'False'
JPY_PARENT_PID = '92'
PYTHONPATH = '/env/python'
TERM = 'xterm-color'
NV_LIBCUSPARSE_DEV_VERSION = '12.5.1.3-1'
GIT_PAGER = 'cat'
LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'
NV_CUDNN_VERSION = '9.2.1.18-1'
SHLVL = '0'
PAGER = 'cat'
COLAB_LANGUAGE_SERVER_PROXY = '/usr/colab/bin/language_service'
NV_CUDA_LIB_VERSION = '12.5.1-1'
NVARCH = 'x86_64'
UV_CONSTRAINT = ''
PYTHONUTF8 = '1'
NV_CUDNN_PACKAGE_DEV = 'libcudnn9-dev-cuda-12=9.2.1.18-1'
MPLBACKEND = 'module://matplotlib_inline.backend_inline'
NV_LIBNCCL_PACKAGE = 'libnccl2=2.22.3-1+cuda12.5'
LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'
COLAB_GPU = ''
GCS_READ_CACHE_BLOCK_SIZE_MB = '16'
NV_CUDA_NSIGHT_COMPUTE_VERSION = '12.5.1-1'
NV_NVPROF_VERSION = '12.5.82-1'
LC_ALL = 'en_US.UTF-8'
_PYVIZ_COMMS_INSTALLED = '1'
COLAB_FILE_HANDLER_ADDR = 'localhost:3453'
PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/opt/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'
NV_LIBNCCL_PACKAGE_NAME = 'libnccl2'
COLAB_DEBUG_ADAPTER_MUX_PATH = '/usr/local/bin/dap_multiplexer'
NV_LIBNCCL_PACKAGE_VERSION = '2.22.3-1'
PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'
MODEL_PROXY_BASE_URL = 'https://mp.kaggle.net/models/openapi'
DEBIAN_FRONTEND = 'noninteractive'
COLAB_BACKEND_VERSION = 'next'
OLDPWD = '/'
_ = '/usr/local/bin/buildozer'
PACKAGES_PATH = '/root/.buildozer/android/packages'
ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'
ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r25b'
ANDROIDAPI = '34'
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
I think this is an issue with the way pip implements the --python-version option. See:
- https://github.com/pypa/pip/issues/13397
- https://github.com/pypa/pip/issues/11664
Thank you @mhsmith let me try and find a way around the issue.