This is a simple example Android app written in PySide6.
This example uses a custom deployment script instead of pyside6-android-deploy that is included in PySide6.
- Linux (macOS might be compatible, Windows will not work)
- Python 3.11 (fixed version requirement by Buildozer)
- PySide6 6.9.1 (other versions may be compatible, requires script modifications)
- OpenJDK 17
- uv and dependencies defined in
pyproject.toml
Additionally, this guide only covers building for ARM64-v8 devices. Other and/or older devices are not covered in this guide, as they require manual cross-compilation of the Qt framework.
Important
Ensure that all of the above requirements are met. Even minor version differences will cause issues during the build.
python3 -m venv .venv
source ./.venv/bin/activate
pip install uvuv sync --extra buildA custom configuration script is provided to prepare Buildozer
python configure.pybuildozer android debug --verboseIf the command succeeds, the built APK should end up in dist/
The buildozer.spec file contains all of the configurations for Buildozer.
Warning
All requirements must be defined under app.requirements, otherwise, they will not be included in the APK.
An import error will result in the app crashing on launch.
All options for iOS and/or Kivy are not relevant to this guide.
This build system is compatible with all PySide6 versions from 6.8.0 up.
- Edit the
QT_VERSIONconstant inconfigure.py - Delete the
deploymentand.qtdirectory to removed cached data - Re-run
configure.pyand rebuild
The default pre-enabled Qt modules are Core, Widgets, and Gui.
Modules names are the imported name without the Qt prefix. Ex: using QtCharts will require adding the Charts module.
Enabling an additional module will require updating the configure.py list constant, QT_MODULES. Note that Core, Widgets, and Gui are required in most cases.
Then, delete the deployment directory, re-run configure.py and rebuild.
Update the app.requirements field in buildozer.spec.
If you are using uv, you can run uv tree to view all direct and transient dependencies.
Note that including transient requirements is required.
Note
python3,shiboken6,PySide6 are required.
Warning
typing_extensions is not included by default