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.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/1c15ed79-8a6b-4af3-a9fe-12c4b991a52en%40googlegroups.com.
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!
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/119d0f40-8b44-4192-b710-b209f0772620n%40googlegroups.com.
"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."
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/CAJiM4H99Wo_QoBEDp%2BvC7i2tHjSvUEs4zOcFKC3xus1EVM%2BKLw%40mail.gmail.com.
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!
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/4d9edbcc-ca95-43f2-884a-09efd96ca0f8n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/43ecfcbc-3ab8-40fd-ab65-d92816f1086an%40googlegroups.com.
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:
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/b6f00ca8-b528-4413-908e-a8e6b00cde67n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/b6f00ca8-b528-4413-908e-a8e6b00cde67n%40googlegroups.com.
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.
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
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/1c15ed79-8a6b-4af3-a9fe-12c4b991a52en%40googlegroups.com.
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:
Restart your PC now.
After the reboot, open APK Builder Studio again.
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!"
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"
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/d57c546e-6379-4524-a78d-f874e860f6b0n%40googlegroups.com.
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.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/778263e3-f98b-47d6-ab1a-08ad5baa0164n%40googlegroups.com.
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:
The Reset (The Bomb): Click the BOMB icon (top left). This is mandatory to delete the "broken" environment that is missing all the tools.
The Fresh Install: Click Install WSL. You do not need to reboot your PC this time. A black terminal window will open automatically.
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.
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.
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.
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:
Select KivyMD 2.0.1: Go to the dropdown menu in the app and select the version "KivyMD 2.0.1".
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".
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.
Rules for Success:
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'.
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."
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/36047cc5-9d99-4e7d-ad24-efd19d674212n%40googlegroups.com.
Hi Lan,
To make sure you get the exact same working environment as I have, please follow these steps. This is a clean reset:
The Bomb: Click the BOMB icon in the app to clear the broken environment.
Install WSL: Click the Install WSL button. Ubuntu will download.
The Ubuntu User: Wait for the black window. It will ask for a Username and a Password. Type them and press Enter.
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.
Version Selection: In the app, select KivyMD 2.0.1 from the dropdown.
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."
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/4114cf5e-d09e-4f64-87ec-a4d7b69e2a5fn%40googlegroups.com.
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:
Download the new version from GitHub.
Use the "Bomb" Icon: Click this first to wipe out the old, inconsistent environment. This ensures a completely clean start.
Install WSL: Click the button and finish the Ubuntu setup (username/password).
Setup Buildozer: The app will now install everything strictly according to the config file.
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
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/0d86715a-37d7-459d-95df-b5630608d005n%40googlegroups.com.
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:
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.
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.
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
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/ece3d255-1d6d-4636-876d-c3255ebfbce6n%40googlegroups.com.
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:
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
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.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/1f6e201f-fd0e-4624-a337-e76b31c7784en%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/84818b71-db6f-4a9d-b4b7-ccb45228e70an%40googlegroups.com.
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.
Just hit the 'Update MD Versions' button.
Select version '1.2.0' from the menu.
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
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/ae79bbb6-fdf0-4b8d-9635-43bd48d0b3cfn%40googlegroups.com.