STDERR:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1246, in <module>
main()
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 677, in __init__
getattr(self, command)(args)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 104, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 504, in build_recipes
recipe.build_arch(arch)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1452, in build_arch
super().build_arch(arch)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1289, in build_arch
shprint(
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
for line in output:
File "/home/runner/.local/lib/python3.11/site-packages/sh.py", line 879, in __next__
self.wait()
File "/home/runner/.local/lib/python3.11/site-packages/sh.py", line 796, in wait
self.handle_command_exit_code(exit_code)
File "/home/runner/.local/lib/python3.11/site-packages/sh.py", line 823, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64- v8a__ndk_target_24/python3/android-build/python3 -m build --wheel --config-setting builddir=/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/cryptography/arm64-v8a__ndk_target_24/cryptography/p4a_android_build
STDOUT:
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- cffi>=1.12; platform_python_implementation != 'PyPy'
- setuptools-rust>=1.7.0
- setuptools>=61.0.0
- wheel
* Getting build dependencies for wheel...
Ignoring "sys._home = value" override
Traceback (most recent call last):
File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native- build/Lib/site-packages/pyproject_hooks/_impl.py", line 402, in _call_hook
raise BackendUnavailable(
pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'
ERROR Backend 'setuptools.build_meta' is not available.
Cause: p4a's hostpython has a patched sys._home that breaks virtual environment creation. When python -m build creates an isolated venv to build cryptography, the hostpython's embedded sys._home override prevents setuptools.build_meta from being importable in that venv (hence the "Ignoring sys._home = value" override message).
Pinning cryptography to an older version alone won't fix this — the p4a recipe uses python -m build --wheel for ALL versions, which always creates the broken isolated venv.
Getting ERROR Backend 'setuptools.build_meta' for cryptography package 42.0.1
Cause: p4a's hostpython has a patched sys._home that breaks virtual environment creation. When python -m build creates an isolated venv to build cryptography, the hostpython's embedded sys._home override prevents setuptools.build_meta from being importable in that venv (hence the "Ignoring sys._home = value" override message).
Pinning cryptography to an older version alone won't fix this — the p4a recipe uses python -m build --wheel for ALL versions, which always creates the broken isolated venv.