{"id":9564,"library":"buildozer","title":"Buildozer","description":"Buildozer is a generic Python packager designed to create application bundles for various platforms, primarily Android and iOS, from Python projects (most notably Kivy applications). It automates the complex process of compiling Python code and its dependencies into native packages (APKs, AABs, IPAs). The current version is 1.5.0, and it generally follows Kivy's release cycle, with new versions typically released every few months to support updated SDKs and Kivy versions.","status":"active","version":"1.5.0","language":"en","source_language":"en","source_url":"https://github.com/kivy/buildozer","tags":["kivy","android","ios","packaging","mobile","deployment","cross-platform"],"install":[{"cmd":"pip install buildozer","lang":"bash","label":"Install Buildozer"}],"dependencies":[{"reason":"Required for building Android applications; Buildozer internally uses p4a to create APKs/AABs. Specific versions may be required for certain features (e.g., AAB support).","package":"python-for-android","optional":false},{"reason":"Required for building iOS applications; Buildozer internally uses p4a to create IPAs.","package":"python-for-ios","optional":true},{"reason":"While not strictly a dependency of Buildozer itself, it is the primary framework for which Buildozer is used. Buildozer's default recipes and configurations are optimized for Kivy applications.","package":"kivy","optional":true}],"imports":[],"quickstart":{"code":"# main.py\nfrom kivy.app import App\nfrom kivy.uix.label import Label\n\nclass MyApp(App):\n    def build(self):\n        return Label(text='Hello, Buildozer!')\n\nif __name__ == '__main__':\n    MyApp().run()","lang":"python","description":"Buildozer is primarily a command-line tool. After installing Buildozer and creating a Kivy application (e.g., `main.py`), navigate to your project directory in the terminal. First, initialize Buildozer for your project, which creates a `buildozer.spec` file:\n\n```bash\nbuildozer init\n```\n\nEdit `buildozer.spec` to configure your app, paying attention to `requirements` (e.g., `requirements = python3,kivy`) and `android.min_sdk_version`.\n\nThen, build your application for Android (this will download SDKs/NDKs and compile):\n\n```bash\nbuildozer android debug\n```\n\nThe resulting `.apk` or `.aab` will be found in the `bin/` directory."},"warnings":[{"fix":"Review the changelog for required SDK/NDK versions or `buildozer.spec` changes. Ensure your SDK/NDK are updated via `sdkmanager` and `buildozer.spec` reflects the correct versions.","message":"Buildozer often requires specific versions of Android SDK/NDK components and `python-for-android`. Changes in Buildozer (e.g., v1.4.0 updating default NDK to 23b) or its dependencies can break existing build environments or require manual updates to `buildozer.spec` (e.g., `android.ndk`).","severity":"breaking","affected_versions":"1.4.0 and newer"},{"fix":"Ensure Java JDK (typically 11 or 17) is installed and `JAVA_HOME` is set. Install Android SDK Command-line Tools via Android Studio or `sdkmanager`. Accept all Android SDK licenses by running `sdkmanager --licenses`.","message":"Building Android apps with Buildozer requires a fully configured development environment including Java Development Kit (JDK), Android SDK Command-line Tools, and Android NDK. Buildozer attempts to download these, but manual intervention for licenses or PATH setup is often needed, especially on new systems.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade Buildozer to 1.3.0 or newer and ensure `python-for-android` is up-to-date. Configure `buildozer.spec` with `android.release_unit = aab`.","message":"Support for Android App Bundle (AAB) was introduced in Buildozer 1.3.0 and requires `python-for-android` v2022.03.13 or newer. Older versions of Buildozer or `python-for-android` will not be able to generate AABs.","severity":"breaking","affected_versions":"Before 1.3.0"},{"fix":"If upgrading from very old Buildozer versions, it's often best to regenerate `buildozer.spec` with `buildozer init` and port over relevant settings, rather than manually updating an old one. Ensure your `buildozer.spec` doesn't use `android_old` unless specifically targeting legacy builds.","message":"The default `python-for-android` toolchain target changed significantly around Buildozer v0.33. Older `buildozer.spec` files might have issues if they explicitly reference older toolchain names or configurations that are no longer standard.","severity":"gotcha","affected_versions":"Before 0.33"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Open `buildozer.spec` and verify the `requirements` line (e.g., `requirements = python3,kivy`). Ensure `python-for-android` is updated or that a compatible version is installed.","cause":"Incorrect or missing requirements in `buildozer.spec`, or a very outdated `python-for-android` version that doesn't include the necessary recipes.","error":"Failed to find a python-for-android recipe for 'kivy' or 'python3'"},{"fix":"Run `yes | sdkmanager --licenses` in your terminal to automatically accept all pending Android SDK licenses. Ensure `sdkmanager` is in your PATH.","cause":"The Android SDK components are installed, but the necessary licenses haven't been accepted, preventing tools from being used.","error":"Android SDK requires accepting licenses. To update and/or install new components and accept licenses run `sdkmanager --update`."},{"fix":"Set the `ANDROID_HOME` environment variable to the root of your Android SDK installation. Install the latest Android SDK Command-line Tools using Android Studio or `sdkmanager` itself (if it's already partially set up).","cause":"The `ANDROID_HOME` environment variable is not set correctly, or the Android SDK Command-line Tools are not installed/located where Buildozer expects them.","error":"Error: No such file or directory: '/path/to/android/sdk/tools/bin/sdkmanager'"},{"fix":"Upgrade Buildozer to version 1.1.0 or newer. This issue was fixed in version 1.1.0.","cause":"This specific error indicates Buildozer is attempting to run with Python 2 syntax, while being executed in a Python 3 environment. This was a bug in older Buildozer versions.","error":"Error: NameError: name 'raw_input' is not defined"}]}