Installation procedure for Buildozer

283 views
Skip to first unread message

Olivier Moreau

unread,
Dec 9, 2025, 10:43:16 AM12/9/25
to Kivy users support
Hi Kivy Team,
When I discovered the Kivy platform using Pyton to develop apps for Android and IOS, I was very pleased. I tested the modified Python with the KV language and all was fine with me.
BUT
Before going further, I wanted to send my test app to my Andoid phone using the Kivy addon Buildozer. No need to get too fancy in my app before checking the entire process.

I tried to install it on Raspberry : Error, not supporting ARM!
I tried to install it on Github : Many errors, I gave up
I tried to install it on a brand new Linux computer : Still many errors.

I searched solutions in Buildozer documentation, on forums, on many sites and even with an IA. Still no luck.

SO
If by any chance someone has a complete procedure or, even better, a Docker image, please help me (and help other people in the same situation).
Please don't ask me the numerous error messages or the logs. It would be a waste of time, I better start a new installation from scratch.

I start with this :
OVHcloud instance with :
Linux version 6.14.0-34-generic (buildd@lcy02-amd64-017) (x86_64-linux-gnu-gcc-14 (Ubuntu 14.2.0-19ubuntu2) 14.2.0,

I follow this procedure :
followed by :

Alternatively, does someone sell a proper cloud/web service to just upload main.py and form.kv and dowload the resulting apk ? 

A last word; I just cannot believe this introduction to the installation procedure :
Depending the platform you want to target, you might need more tools installed. Buildozer tries to give you hints or tries to install few things for you, but it doesn’t cover every situation.
This is clearly not a very good incitation to use this software...

Thanks in advance for your support.

Luis Angel Maya Galván

unread,
Dec 9, 2025, 4:58:35 PM12/9/25
to kivy-...@googlegroups.com
Send me message, maybe   i can help You to build the APK from .py file an kv file 

El mar, 9 de dic de 2025, 10:45 a.m., Luis Angel Maya Galván <luisgal...@gmail.com> escribió:
Hello, maybelline o can help You, send messenge and i tell step by step how to build the APK from .py file

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/9893ba31-0ac7-4b16-bae4-21a65281b478n%40googlegroups.com.

Kenechukwu Akubue

unread,
Dec 10, 2025, 2:16:12 AM12/10/25
to Kivy users support
Please post the error you are getting

pedro h

unread,
Dec 30, 2025, 3:32:17 PM12/30/25
to Kivy users support
I’ve also experimented with GitHub Actions and Google Colab in the past. They can work for simple cases, but I often ran into issues that were hard to reproduce or that suddenly appeared again on the next build because the environment changed in the background. What has been the most reliable setup for me is using a local Windows machine with WSL2. If you happen to have access to Windows, this allows you to create a clean and consistent environment where all required components (Python, Buildozer, SDK/NDK, etc.) stay stable across builds. If you want, I can walk you through setting up such an environment or help you get your project building reliably. Just send me a private message so we don’t overload the thread with long logs and configuration details.

Lan Le-Dinh

unread,
Jan 2, 2026, 10:57:23 AMJan 2
to kivy-...@googlegroups.com
Hi Pedo h
Please send me your documents.
Thanks
Lan

pedro h

unread,
Jan 5, 2026, 10:45:20 PMJan 5
to Kivy users support

Hi Lan,

To see if my setup can help you, I need to know a bit more: Are you working on a Windows machine and which KivyMD version are you using?

I’ve developed a small automation that sets up the entire environment (WSL, Android SDK, NDK, etc.) automatically. It’s a GUI-based setup designed to handle the process without terminal commands, which might be easier than following manual documents.

If you are on Windows, I can share the access with you so you can check if it works for your specific project. Let me know your specs!

Lan Le-Dinh

unread,
Jan 5, 2026, 11:01:51 PMJan 5
to kivy-...@googlegroups.com
Hi Pedo H
Thanks for your feedback.
I can set up WSL if that is necessary for using your procedures.
I use Windows 11. I can also set up a new environment with versions for different components you are using to avoid mismatching versions which is usually a comman problem.
Best regards
Lan

pedro h

unread,
Jan 6, 2026, 2:15:25 AMJan 6
to Kivy users support

"Hi Lan,

I have built a tool that handles the WSL installation and the specific NDK/SDK versions automatically. Since you are on Windows 11, it should work fine and you don't have to set up everything manually to avoid the version mismatches.

You can check it out here, everything is explained on how to get an APK build running: 🔗 https://github.com/PedroHSA0802/apk-builder-studio

Let me know if it works for you."

KXJ YEG

unread,
Jan 6, 2026, 12:50:10 PMJan 6
to kivy-...@googlegroups.com
WSL is no doubt an effective tool for Linux build env in Windows, gets the job done most times. 

If you ever feel like you want to use a Linux Virtual Environment under Windows  (I use Oracle Virtualbox) because of specific WSL issues,  this video can help:


Thanks

pedro h

unread,
Jan 6, 2026, 3:16:01 PMJan 6
to Kivy users support

Setting up a full virtual machine is definitely a valid path, but as I found out when I started, it’s often more complicated than it looks.

I personally moved away from that because I didn't want to manage gigabytes of VM images and deal with the manual setup every time. That’s exactly why I focused on developing a way to build APKs directly on Windows using WSL—it gives you a clean Linux environment without the overhead of heavy third-party virtualization software.

In my experience, this automated WSL method has led to consistent and reproducible builds. Of course, a full VM remains a solid alternative for those who prefer the manual installation and configuration process.

Whichever way one chooses, the ultimate goal is to get that APK running!

Lan Le-Dinh

unread,
Jan 6, 2026, 4:01:17 PMJan 6
to kivy-...@googlegroups.com
Hi Pedo
Thanks for your quick reply and great work.
I definitely will try it out.
Best regards
Lan


KXJ YEG

unread,
Jan 6, 2026, 4:05:41 PMJan 6
to kivy-...@googlegroups.com
Great inputs.

On the other hand I moved closer to virtual environments because it allowed greater flexibility to bind older, working versions of libraries rather than the more recent WSL/OS bindings that were automatically enforced but failed unexpectedly. You might ask why anyone would want older versions at all. Well, the peculiar thing with Kivy apps I've see is that sometimes the more recent combo of libraries/cython etc. or the latest python version would crash with hard to debug issues. This points to insufficient testing in the community w.r.t. C or cython support for the underlying android hardware, which did not keep up with libraries or python evolution. Sometimes your build can stumble because there is no wheel for your apk and then you need to go back to an older version that works. 

Managing strategic virtual machines helped me work around these issues. In fact, since 2023 I've built 100% of my working APKs in the virtual machine described in that video only, as other options didn't work.

Anyway, great exchange of notes. I guess the method that'll work for op will depend on their specific needs. WSL is definitely worth trying. 


pedro h

unread,
Jan 6, 2026, 7:29:28 PMJan 6
to Kivy users support

I completely agree, kxj—the version mismatch between Cython and Python is the number one reason builds fail. However, that’s exactly why I didn't go the 'global install' route. My tool uses a Template-based Environment Strategy:

  • Environment Pre-Configuration: Before even touching Buildozer, my app uses a 'Config Editor' to set up the WSL environment. You can literally copy-paste the entire configuration from a text file or any specific requirements into this editor window.

  • Isolated Setup: The tool then builds a fresh, isolated virtual environment based on that 'recipe'. This ensures the 'workshop' is perfectly prepared before the actual build starts.

  • Reproducibility: You can share these 1KB config files. If someone has a working setup for an old Kivy project, they just share the text, and my tool recreates that exact environment on any Windows machine.

Here is the environment 'recipe' (Pre-Build Config) I use for a stable KivyMD 2.0.1 setup. You can simply paste this into the App's Config Editor:



# APK Builder Configuration (KivyMD 2.0.1)
# Edit this file for custom builds

[python]
version = 3.11

[system-packages]
# Ubuntu/WSL system packages, including JDK 17
software-properties-common
openjdk-17-jdk
git
zip
unzip
build-essential
libffi-dev
libssl-dev
python3-dev
cmake
ninja-build
pkg-config
autoconf
automake
libtool
patch
ant
python3.11
python3.11-venv
python3.11-dev

[python-packages]
# Python/Pip packages for the build environment
pip==23.0.1
wheel==0.40.0
setuptools==67.6.1
cython==0.29.33
buildozer==1.5.0
pybind11==2.11.1

[buildozer-requirements]
# Essential requirements for KivyMD 2.x (not project-specific)
python3
kivy==2.3.1
https://github.com/kivymd/KivyMD/archive/master.zip
materialyoucolor
asynckivy
asyncgui
numpy
pyjnius

[android-sdk]
# Evaluated by the "Install Android SDK" button
install = true
api = 33
build_tools = 33.0.2

[java]
# JDK version for Gradle/AGP (AGP 8.x requires >= 11; 17 is recommended)
jdk = 17

[gradle]
# Gradle version (p4a/Buildozer generates the wrapper; pinning stable here)
version = 8.0.2

[agp]
# Android Gradle Plugin version (compatible with Gradle 8.0.2, requires JDK >= 11)
version = 8.1.1

[android]
# 64-bit ARM only for faster and resource-efficient builds
archs = arm64-v8a

[build-flags]
# Memory-saving flags (can be increased if needed)
makeflags = -j1
ninjaflags = -j1
gradle_xmx = 1024m

Tebogo Christopher

unread,
Jan 7, 2026, 11:14:00 AMJan 7
to kivy-...@googlegroups.com
Install linux ubuntu virtual use your command promp to configure the bulldozer it will work 

KXJ YEG

unread,
Jan 7, 2026, 11:25:22 AMJan 7
to kivy-...@googlegroups.com
Just for clarification, I don't recommend a 'global install' whether you go virtual machine or WSL. The proper way is to create python venvs (virtual envs) as per your build's need. A virtual machine allows me to backup snapshots of each venv. This helps with version control especially when we have multiple production builds. I'm sure WSL allows something similar.


pedro h

unread,
Jan 7, 2026, 4:38:38 PMJan 7
to Kivy users support

Hi kxj,

Thank you for the clarification. I completely understand that as an experienced developer, you wouldn't use a global installation and that you rely on python venvs for proper version control. My tool actually follows that same principle: it creates isolated environments within WSL to keep everything clean.

My approach follows the same logic of stability as yours, but with a much leaner way of managing it: Text files instead of Gigabytes. Instead of saving an entire environment or venv as a heavy image file or snapshot, I use simple TXT files. The app features a built-in editor where you can paste your requirements (Python version, packages, SDK specs). Once saved, the tool builds the complete WSL environment and the necessary venvs strictly according to this recipe at the push of a button.

The major advantage is the portability: If a user creates a perfect configuration for a specific KivyMD version, they can simply share this recipe as a text file with someone else. That person just copies the text into their app's editor, clicks install, and gets the exact same build environment on their PC—without ever typing a single command into a terminal. You can keep a folder full of these tiny recipes for different projects and bring them back to life anytime via copy-paste. It’s the same result as your VM snapshots, but we’re talking about kilobytes instead of gigabytes.

Of course, I am still in the testing phase and haven't had the chance to personally verify the transfer of a config file to a different PC yet to see if it creates the exact same environment there. However, since the app installs strictly according to these instructions, I am very confident that it works. That is exactly the goal of my work—to make the process as portable and simple as possible.

Lastly, I want to emphasize that I am fully convinced of your approach as well. I know that working with virtual machines is a proven and effective method. In the end, your way is just as right as any way someone finds that works best for them.

Olivier Moreau

unread,
Jan 14, 2026, 8:37:22 AMJan 14
to Kivy users support
Hello everybody and happy new year.

I waited more than a month to see all the replies to my post. More than 100 views, and 15 replies, not bad.

Unfortunately there is no clear solution emerging. One interesting solution from 'pe3' is to use WSL and follow his procedure. But why do we need Windows ? I use a Linux machine for dev and a Win machine for home stuff. 

Not a word from Kivy team and no change in the Buildozer documentation. "Finally, you will learn how to Deploy on the device of your choice." "Finally" == "One day may be" is still True.

For my project I just needed an simple app to setup a Raspberry Pico device. I've done the job with a simple web server (phew) and a peer-to-peer Wifi. Alternatively I built a PCB with a 'keyboard' (4 buttons) and a 'screen' (OLED 128x32) for data input. I'm also checking other tools to build APK in the future (anvpy, bitrise, etc..).

Anyway thanks for your support and good luck to setup correctly your Buildozer.

pedro h

unread,
Jan 14, 2026, 12:35:54 PMJan 14
to Kivy users support

Hi Olivier,

Actually, the "clear solution" is already here. As I mentioned earlier in this thread, I developed APK Builder Studio specifically to automate the environment setup that is causing you so much trouble on native Linux.

Since you have a Windows machine available, you can use it as a stable bridge. The tool handles the WSL setup and all dependencies automatically. It takes a short time to get everything running and avoids the manual troubleshooting you've been dealing with for the past month.

A note on Security: I am fully aware that downloading and running an .exe installer can raise security concerns. To address this and provide "black on white" proof of the app's integrity, I personally submitted it to Microsoft Security Intelligence for a manual audit.

My goal was to eliminate any "false positive" alerts and ensure that users can trust the software 100%. The result is official: Microsoft has verified the app as safe and whitelisted it.

  • Status: ✅ Officially Verified & Safe

  • Submission ID: 41e5748c-5ed7-4e2b-9043-fbfd7d767957

  • Verification: You can confirm this yourself by right-clicking the file and selecting "Scan with Microsoft Defender."

If you want to finally get your APK built without the terminal struggle, you can find the verified version here: 🔗 https://github.com/PedroHSA0802/apk-builder-studio

Best regards, Pedro

pedro h

unread,
Jan 14, 2026, 12:44:48 PMJan 14
to Kivy users support
If you decide to give this method a try, I would really appreciate your feedback! Let me know what you liked, what could be improved, or if you encounter any difficulties. You can reach out to me here or open an issue directly on the GitHub page

Radosław Głębicki

unread,
Jan 14, 2026, 12:45:34 PMJan 14
to Kivy users support
Hi. Why is not error presented by you? Help us to help you. Yesterday I did it. I compiled to apk after days of trying. Problem with versions of Python, Cythona and java. Show us your error.

Radek Glebicki

Lan Le-Dinh

unread,
Jan 17, 2026, 10:50:30 AMJan 17
to kivy-...@googlegroups.com
Hi Pedro
When I ran WSL, it got stuck at Step 2 of 2: Install Ubuntu.
What should I do?
Regards¨
Lan

On Tue, Dec 30, 2025 at 9:32 PM 'pedro h' via Kivy users support <kivy-...@googlegroups.com> wrote:

pedro h

unread,
Jan 17, 2026, 11:25:21 AMJan 17
to Kivy users support

When you run the WSL installation for the first time, Windows enables the necessary system features but requires a full restart to activate them.

The solution is simple:

  1. Restart your PC now.

  2. After the reboot, open APK Builder Studio again.

  3. Click the 'Install WSL' button one more time.

Since the features are now active after the restart, it will skip Step 1 and finish the Ubuntu installation (Step 2) in a few seconds. After that, you can proceed with the Environment Setup!"

pedro h

unread,
Jan 17, 2026, 11:30:49 AMJan 17
to Kivy users support

Please let me know if it worked! If you run into any other messages or get stuck again, just send me a quick note. I want to make sure you get your first APK built successfully.

Best regards, Pedro"

Lan Le-Dinh

unread,
Jan 18, 2026, 7:22:58 AMJan 18
to kivy-...@googlegroups.com
Hi Pedro
Thanks for your quick answer.
I ran it on my HP laptop with Windows 10 and it works after I allowed virtualization.
Now I have a problem in the last step i.e. Install the Android SDK.
Error message:

>>> Starting Android SDK Installation/Update...
/tmp/apk_sdk_install.sh: line 1: /home/lan/.buildozer_venv/bin/activate: No such file or directory
Buildozer Venv not activatable. Trying to create.
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.12-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: /home/lan/.buildozer_venv/bin/python3

Error: Could not create Venv.

Best regards
Lan


Lan Le-Dinh

unread,
Jan 18, 2026, 7:34:38 AMJan 18
to kivy-...@googlegroups.com
BTW I use python 3.13.5

pedro h

unread,
Jan 18, 2026, 8:26:24 AMJan 18
to Kivy users support

Hey Lan, I've been investigating the issue. I just did a 100% clean install on my machine with the latest Windows and Ubuntu 24.04, and everything worked perfectly.

Before we continue, I have one important question: Did you ever try to install WSL, Ubuntu, or Python/Buildozer manually on this PC before using my app?

If yes, your system might have 'leftovers' or path conflicts (especially since you have Python 3.13 on Windows). If that's the case, please use the 'Bomb Button' in my app. I built it specifically to wipe out old, corrupted WSL instances so you can start with a 100% clean slate. It's the only way to make sure no old settings are breaking the new installation.

Lan Le-Dinh

unread,
Jan 18, 2026, 8:30:04 AMJan 18
to kivy-...@googlegroups.com
Pedro
Thanks for your feedback.
This is a clean machine. I never installed WSL or python on it.
I am doing troubleshooting.
Best regards
Lan


Lan Le-Dinh

unread,
Jan 18, 2026, 9:20:09 AMJan 18
to kivy-...@googlegroups.com
Now I got:
# Cwd /home/lan/.buildozer/android/platform/android-sdk
Traceback (most recent call last):
  File "/home/lan/.buildozer_venv/bin/buildozer", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/__init__.py", line 1024, in run_command
    self.target.run_commands(args)
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/target.py", line 93, in run_commands
    func(args)
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/target.py", line 103, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/__init__.py", line 172, in prepare_for_build
    self.target.install_platform()
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/targets/android.py", line 614, in install_platform
    self._install_android_sdk()
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/targets/android.py", line 381, in _install_android_sdk
    self.buildozer.file_extract(archive,
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/__init__.py", line 616, in file_extract
    self.cmd(["unzip", "-q", join(cwd, archive)], cwd=cwd)
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/buildozer/__init__.py", line 289, in cmd
    process = Popen(command, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'unzip'
>>> Searching for sdkmanager again after bootstrap...
Critical Error: sdkmanager could not be found...

Lan Le-Dinh

unread,
Jan 18, 2026, 9:39:00 AMJan 18
to kivy-...@googlegroups.com
I think that I need to have the same version of JDK that you used.
Please let me know what version of JDK you used.
I installed version 25.

pedro h

unread,
Jan 18, 2026, 10:27:22 AMJan 18
to Kivy users support

Hi Lan, I just tested the entire process myself on my machine. The error you have (unzip missing and Python 3.12) happens when the initial Ubuntu setup is skipped.

Please follow these 4 steps in this exact order:

  1. The Reset (The Bomb): Click the BOMB icon (top left). This is mandatory to delete the "broken" environment that is missing all the tools.

  2. The Fresh Install: Click Install WSL. You do not need to reboot your PC this time. A black terminal window will open automatically.

  3. The Unix User (Crucial): Wait for the black window to ask you:

    • Create a default Unix user account: -> Type your name and press Enter.

    • Enter new UNIX password: -> Type a password and press Enter. (Important: You won't see any stars or dots while typing, just keep typing and hit Enter).

    • Retype new password: -> Type it again and press Enter.

    • Once you see your name in green text, you can close the window.

  4. The App Setup: * Now click Setup Environment in the app. Use the password you just created. This will now successfully install unzip and the correct Python version.

    • Finally, click Install Buildozer.


Why this fixes everything:

By using the Bomb, we make sure the "wrong" Python 3.12 is gone. By creating the User Account, you give the app the permission to install unzip. Once unzip is there, the crash you sent me will never happen again.

pedro h

unread,
Jan 18, 2026, 10:35:58 AMJan 18
to Kivy users support

Final Steps after creating your Username/Password

Hi Lan, once you have successfully created your Username and Password in the black Ubuntu window and you see the green command line, please follow these final steps in the app:

  1. Select KivyMD 2.0.1: Go to the dropdown menu in the app and select the version "KivyMD 2.0.1".

  2. Install Buildozer: Click the Install Buildozer button. This will use my configuration to install the correct Python 3.11, JDK 17, and all tools (like unzip) into your new system. Wait until it says "Finished".

  3. Install Android SDK: Only after Buildozer is completely installed, click the Install Android SDK button. This will download the correct Android tools that match KivyMD 2.0.1.

Important: Do not skip Step 1! Selecting 2.0.1 ensures that the app installs the modern JDK 17 automatically, so you don't have to fix anything manually.

pedro h

unread,
Jan 18, 2026, 10:54:07 AMJan 18
to Kivy users support

Rules for Success:

  1. When you click a button, a black window opens. DO NOT CLOSE IT. > 2. You must wait until it says 'Setup finished!' or 'Script finished. Press Enter to close'.

  2. If you close the window earlier, the installation is 'killed' and the next step will fail.

I tested this on multiple PCs: The app works 100%, but you must let the black windows finish their job. Please try again and just watch the window until it stops by itself."

Lan Le-Dinh

unread,
Jan 18, 2026, 11:13:29 AMJan 18
to kivy-...@googlegroups.com
It is in the step "Install Android SDK" that I have a problem.

pedro h

unread,
Jan 18, 2026, 11:35:47 AMJan 18
to Kivy users support

Hi Lan,

To make sure you get the exact same working environment as I have, please follow these steps. This is a clean reset:

  1. The Bomb: Click the BOMB icon in the app to clear the broken environment.

  2. Install WSL: Click the Install WSL button. Ubuntu will download.

  3. The Ubuntu User: Wait for the black window. It will ask for a Username and a Password. Type them and press Enter.

  4. The Command Line: Wait until the terminal stops working and shows your username (it might be blue or green text). This means Ubuntu is ready. Now you can close (X) this terminal.

  5. Version Selection: In the app, select KivyMD 2.0.1 from the dropdown.

  6. Install Buildozer: Click 'Install Buildozer'.

    • A terminal opens. Enter your password and press Enter.

    • STRICT RULE: Do NOT close this window. Wait until the installation is 100% finished and you see the 'Finished' message.

Only after this is done, click 'Install Android SDK'. The reason your SDK failed before is that you skipped the full installation of step 6."

Lan Le-Dinh

unread,
Jan 18, 2026, 8:57:46 PMJan 18
to kivy-...@googlegroups.com
Hi Pedro
Thanks for your detailed instructions.
I will try again.
Best regards
Lan

Lan Le-Dinh

unread,
Jan 19, 2026, 1:45:13 AM (14 days ago) Jan 19
to kivy-...@googlegroups.com
I got the same error message:
>>> Starting Android SDK Installation/Update...
>>> Searching for sdkmanager...
[Bootstrap] Checking/creating cmdline-tools via Buildozer...
# Check configuration tokens
# Ensure build layout
# Create directory /home/lan/.buildozer
# Create directory /home/lan/.buildozer/cache
# Create directory /home/lan/.apk_sdk_bootstrap/.buildozer
# Create directory /home/lan/.apk_sdk_bootstrap/bin
# Create directory /home/lan/.apk_sdk_bootstrap/.buildozer/applibs
# Create directory /home/lan/.buildozer/android/platform/android/platform
# Create directory /home/lan/.apk_sdk_bootstrap/.buildozer/android/platform
# Create directory /home/lan/.apk_sdk_bootstrap/.buildozer/android/app
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/lan/.buildozer_venv/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-17-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-17-openjdk-amd64/bin/keytool
# Install platform
# Run ['git', 'clone', '-b', 'master', '--single-branch', 'https://github.com/kivy/python-for-android.git', 'python-for-android']
# Cwd /home/lan/.apk_sdk_bootstrap/.buildozer/android/platform
Cloning into 'python-for-android'...
# Run ['/home/lan/.buildozer_venv/bin/python3.12', '-m', 'pip', 'install', '-q', 'appdirs', 'colorama>=0.3.3', 'jinja2', 'sh>=1.10, <2.0; sys_platform!="win32"', 'build', 'toml', 'packaging', 'setuptools']
# Cwd None
ERROR: Exception:

Traceback (most recent call last):
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 345, in run
    session = self.get_default_session(options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 98, in get_default_session
    self._session = self.enter_context(self._build_session(options))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 125, in _build_session
    session = PipSession(
              ^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/network/session.py", line 343, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/network/session.py", line 175, in user_agent
    setuptools_dist = get_default_environment().get_distribution("setuptools")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 188, in get_distribution
    return next(matches, None)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 183, in <genexpr>
    matches = (
              ^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/base.py", line 612, in iter_all_distributions
    for dist in self._iter_distributions():
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 176, in _iter_distributions
    for dist in finder.find_eggs(location):
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 144, in find_eggs
    yield from self._find_eggs_in_dir(location)
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 111, in _find_eggs_in_dir
    from pip._vendor.pkg_resources import find_distributions
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2164, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

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/lan/.buildozer_venv/lib/python3.12/site-packages/pip/__main__.py", line 31, in <module>
    sys.exit(_main())
             ^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 70, in main
    return command.main(cmd_args)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 101, in main
    return self._main(args)
           ^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 216, in _main
    self.handle_pip_version_check(options)
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 179, in handle_pip_version_check
    session = self._build_session(
              ^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 125, in _build_session
    session = PipSession(
              ^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/network/session.py", line 343, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/network/session.py", line 175, in user_agent
    setuptools_dist = get_default_environment().get_distribution("setuptools")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 188, in get_distribution
    return next(matches, None)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 183, in <genexpr>
    matches = (
              ^
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/base.py", line 612, in iter_all_distributions
    for dist in self._iter_distributions():
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 176, in _iter_distributions
    for dist in finder.find_eggs(location):
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 144, in find_eggs
    yield from self._find_eggs_in_dir(location)
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 111, in _find_eggs_in_dir
    from pip._vendor.pkg_resources import find_distributions
  File "/home/lan/.buildozer_venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2164, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
# Command failed: ['/home/lan/.buildozer_venv/bin/python3.12', '-m', 'pip', 'install', '-q', 'appdirs', 'colorama>=0.3.3', 'jinja2', 'sh>=1.10, <2.0; sys_platform!="win32"', 'build', 'toml', 'packaging', 'setuptools']
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     WSL2_GUI_APPS_ENABLED = '1'
#     WSL_DISTRO_NAME = 'Ubuntu'
#     NAME = 'DESKTOP-E6F9GBQ'
#     PWD = '/home/lan/.apk_sdk_bootstrap'
#     LOGNAME = 'lan'
#     HOME = '/home/lan'
#     LANG = 'C.UTF-8'
#     WSL_INTEROP = '/run/WSL/381_interop'
#     VIRTUAL_ENV = '/home/lan/.buildozer_venv'
#     WAYLAND_DISPLAY = 'wayland-0'
#     ANDROID_HOME = '/home/lan/.buildozer/android/platform/android-sdk'
#     TERM = 'xterm-256color'
#     USER = 'lan'
#     DISPLAY = ':0'
#     SHLVL = '1'
#     ANDROID_SDK_ROOT = '/home/lan/.buildozer/android/platform/android-sdk'
#     VIRTUAL_ENV_PROMPT = '(.buildozer_venv) '
#     XDG_RUNTIME_DIR = '/run/user/1000/'
#     PS1 = '(.buildozer_venv) '
#     WSLENV = ''
#     PATH = ('/home/lan/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/lan/.buildozer_venv/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/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/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program '
 'Files/Java/jdk-25/bin:/mnt/c/Users/admin/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/admin/AppData/Roaming/npm:/mnt/c/Users/admin/AppData/Local/Python/bin')
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
#     HOSTTYPE = 'x86_64'
#     PULSE_SERVER = 'unix:/mnt/wslg/PulseServer'
#     OLDPWD = '/home/lan'
#     _ = '/home/lan/.buildozer_venv/bin/buildozer'
#
# 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

>>> Searching for sdkmanager again after bootstrap...
Critical Error: sdkmanager could not be found...
lan@DESKTOP-E6F9GBQ:~$
Message has been deleted

pedro h

unread,
Jan 21, 2026, 4:49:14 AM (12 days ago) Jan 21
to Kivy users support

Subject: Important Update: New Config-Driven Buildozer App

Hi Lan,

I’ve spent the last few days completely rebuilding the app's core logic. The issue we had was that the previous version didn't strictly follow the configuration file, which caused errors on your specific system.

The Fix: The app is now strictly driven by the config.txt. I have improved the code so it now forces the exact Python and Java versions defined in your configuration, making the installation much more robust across different PCs. I am very confident that this fix has solved the problem you were facing.

To get started, please follow these steps:

  1. Download the new version from GitHub.

  2. Use the "Bomb" Icon: Click this first to wipe out the old, inconsistent environment. This ensures a completely clean start.

  3. Install WSL: Click the button and finish the Ubuntu setup (username/password).

  4. Setup Buildozer: The app will now install everything strictly according to the config file.

  5. Install Android SDK: Complete the final step for the tools.

I hope that with this new version, we both achieve our goals: for me, that the app performs exactly as it should on every PC, and for you, that you can finally create your APK successfully. I am very confident that this update has cleared the way.

Let’s do this!

Best regards, Pedro

Lan Le-Dinh

unread,
Jan 22, 2026, 2:16:55 AM (11 days ago) Jan 22
to kivy-...@googlegroups.com
Hi Pedro
Thanks for your feedback.
I really appreciate your efforts.
It works perfectly and I could generate an apk file. I tested it on my Android phone and it works as expected.
Great work.
Best regards
Lan

pedro h

unread,
Jan 23, 2026, 4:31:21 AM (10 days ago) Jan 23
to Kivy users support

Hi Lan,

That is fantastic news! I am very happy to hear that it works perfectly now and that you were able to generate and test your APK on your phone.

The main reason it finally worked was that we successfully forced the system to use Python 3.11 and JDK 17, which bypassed those "pkgutil" errors you had with the newer versions.

Important Tip for the future (to keep builds fast):

Now that your environment is fully set up, every future build will take only 2-3 minutes instead of 20 – but only if you follow these rules:

  1. Do NOT delete the .buildozer folders INSIDE your project directories that were generated by my app. These folders are the "memory" of your project. If you delete them, the next build for that project will take 20 minutes again.

  2. How to update your App: If you change your code (e.g., your main.py, main.kv or other assets), do not reset the environment. Simply open the Linux Explorer (second screen in my app) and replace only your project files (the scripts) in that directory.

  3. Cleanup: You should only delete old .buildozer folders from previous manual attempts or other methods. But keep every .buildozer folder that was created inside a project by this app, as this is your guarantee for super-fast builds!

Once you have replaced your script files via the Linux Explorer, just hit the Build button again and your new APK will be ready in no time.

Have fun developing your Kivy apps! If you run into any more issues, just let me know.

Best regards,

Pedro

KXJ YEG

unread,
Jan 23, 2026, 2:26:44 PM (9 days ago) Jan 23
to kivy-...@googlegroups.com
Great to know. It will help boost developer confidence and reduce doubt in our minds as to whether Kivy is even a viable option for serious apps.

However, the question I raised remains unaddressed. 

Does this method work easily for lower versions? You saw problems pop up and had to use the more recent Python 3.11 and JDK 17 to make this work.

That's the specific problem I address with my VM approach:

There are many hardware dependent utilities out there that simply don't work with newer Python and/or Python/Cython + JDK combo.

Why do you care about older stuff? Because a lot of these hardware dependent utilities offer specialized functions like camera & sensor access for Telemetry. Not many alternatives to Kivy if you're Python heavy already and want Android access.

And that's where I found my solution to rescue me https://youtu.be/hxXIuiHLubU; indeed it helped numerous developers too if you read the comments.

It's there if anyone needs it https://youtu.be/hxXIuiHLubU.

Again, the intent is not a beauty contest of solutions :) We know Kivy isn't smooth as butter so want the community to remain best equipped.














pedro h

unread,
Jan 23, 2026, 4:08:33 PM (9 days ago) Jan 23
to Kivy users support

Hi KXJ,

You are absolutely right to point that out. The use of Python 3.11/JDK 17 for Lanle was just one specific setup. My app is designed to be version-agnostic, meaning it can handle those legacy hardware-dependent projects just as easily.

The strength of the "Apk-Builder-Studio" is that it manages the entire stack (Python, JDK, and Android SDK) through the configuration files.

If you need to build a legacy app with Python 3.8, you simply adjust the build-config.txt like this:



[python] 
version = 3.8 
[system-packages] 
# The app handles the installation of the specific legacy versions 
python3.8
python3.8-venv
python3.8-dev
openjdk-11-jdk = 
# ... other dependencies [java] # Here you define the matching JDK (e.g., 11 for older Gradle versions)
 jdk = 11 
[android-sdk] 
api = 28 build_tools = 28.0.3

Why this addresses your concern: When you click "Setup", the tool reads these values and injects them into a clean WSL/Ubuntu environment. It will run sudo apt install openjdk-11-jdk and set up a Python 3.8 virtual environment automatically.

This gives you the same "frozen stability" as your VM approach, but without the bulk. You can have different config files for different projects and switch between "Modern" and "Legacy" setups in minutes by simply hitting the "System Reset" (Bomb/Broom icon) and running the setup with the other config.

It’s all about giving the developer full control over the environment variables without the "Buildozer headache."

Best regards, Pedro

pedro h

unread,
Jan 23, 2026, 5:20:59 PM (9 days ago) Jan 23
to Kivy users support

To be completely transparent about the case with Lanle: The issue wasn't actually a compatibility problem with Python 3.11 or JDK 17. I discovered a bug in my app's installation logic where it incorrectly defaulted to the host's system Python (Ubuntu 24.04's Python 3.12) instead of strictly following the version defined in the build-config.txt.

Since Buildozer doesn't fully support 3.12 yet, the build failed. After fixing this logic, the app now correctly injects whichever Python version is specified in the config into the virtual environment. This fix confirms that the system is now truly flexible—whether you need 3.8, 3.10, or 3.11, the environment remains isolated and predictable.

Lan Le-Dinh

unread,
Jan 23, 2026, 7:05:31 PM (9 days ago) Jan 23
to kivy-...@googlegroups.com
Hi Pedro
It is good to know. I wanted to ask the same question.
Best regards
Lan

KXJ YEG

unread,
Jan 23, 2026, 8:11:26 PM (9 days ago) Jan 23
to kivy-...@googlegroups.com
Hi Pedro,

That's a cool pathway you got there.

I’ll keep it short.

Bunch of my early issues were OpenGL errors, plus Pillow (PIL) and Cython compatibility when building for Android.

Android camera 'Texture' can be quirky (https://youtube.com/shorts/6aloVoPlnWY?si=3h-keDE1Mpdg9Os1).

I also read about glitchy telemetry; saw reports online about WSL2 timing quirks for certain workflows. I needed Telemetry but didn't have enough time to bet on WSL and then find out, so I’m not claiming WSL was the root cause, but it felt uncertain so I moved on.

Android Texture has to be validated on the actual phone hardware. WSL can render through OpenGL-DirectX; while it won’t change on-device behavior, you've to make sure “what you see” previews e.g. rotations match device behavior.

WSL is great for fast iteration. For release builds, I prefer fewer moving parts; find the “golden” config, snapshot it in an Ubuntu VM, reuse it. The VM overhead is a small price for reproducibility vs. losing days/weeks chasing obscure bugs plus its noise for production users. That “golden image” approach is what this video advocates (https://youtu.be/hxXIuiHLubU).

Just clarifying, WSL is a first class tool for fast development cycles. I just want stable, repeatable production builds.

If you’re using WSL for production esp. Android telemetry or image-processing builds, I’d genuinely appreciate reports on whether these risk points are solved. I’d love to adopt WSL for faster iterations if the production risk is clearly low.

Regards

pedro h

unread,
Jan 24, 2026, 7:47:19 AM (9 days ago) Jan 24
to Kivy users support

Hi KXJ,

I’ve followed your previous posts and I'm well aware of your stance on the stability of VMs versus WSL, especially regarding the 'Golden Image' approach you've often advocated. I definitely don't see your VM method as 'bad'—it’s a proven, rock-solid way to handle production builds.

However, I’d still like to invite you to test my tool specifically as a headless 'Build Factory'. Since the app is only used to compile the APK while you continue to code in your own Windows environment, the OpenGL/Texture quirks of WSL shouldn't be a factor at all.

To give it a fair stress test with your requirements: I have uploaded a specific configuration for KivyMD 1.2.0 to the server, aimed at the stability you need for production.

  1. Just hit the 'Update MD Versions' button.

  2. Select version '1.2.0' from the menu.

  3. Use the 'Edit Build Config' button to verify or tweak the versions (Python 3.9, JDK 11, Cython 0.29.33, etc.) yourself.

Since you've dealt with the most difficult edge cases like Android telemetry and camera textures, your critique on whether this WSL-based 'Golden Config' can actually match a VM's reliability would be incredibly valuable.

Best regards, Pedro

KXJ YEG

unread,
Jan 27, 2026, 11:56:25 PM (5 days ago) Jan 27
to kivy-...@googlegroups.com
Hi

Thanks for your diligence, this is really the kind of different plans we need to bulletproof often shaky Kivy projects.

I wouldn't say mine are difficult test cases - I find them more quirky because of how Python camera and such fit in the Android mix.

Due to time constraints, rather than me trying, I'd be more interested if someone volunteers to build a test app with things like camera4kivy (https://youtu.be/XjikrIclkas?si=kQpvLhaZef4Dz7TO) on WSL and share findings. 

Kind regards


Reply all
Reply to author
Forward
0 new messages