BeeWare building for android from Windows failed on > Task :app:extractDebugPythonBuildPackages

2 days ago 5
ARTICLE AD BOX

I'm trying to build my app, and I'm building with BeeWare for android, but it fails at > Task :app:extractDebugPythonBuildPackages. I have successfully built it for Windows and can safely distribute it, but it doesn't work when building for Android. I am following the tutorial by the way, and I'm still new to python app development, so I might be missing something critical.

The issue occurs when I run briefcase build android -v in the console in my project's main directory. When it reaches this step in the process, this happens (small snippet of full process, also note my project is called beewaretutorial):

[beewaretutorial] Building Android APK... > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE > Task :app:extractDebugPythonBuildPackages FAILED

When entering the main directory's "build\beewaretutorial\android\gradle", and then entering the command .\gradlew assembleDebug --info into the command line, I get a more verbose view of the error, which I have pasted part of below:

> Task :app:extractDebugPythonBuildPackages Custom actions are attached to task ':app:extractDebugPythonBuildPackages'. Caching disabled for task ':app:extractDebugPythonBuildPackages' because: Build cache is disabled Caching has not been enabled for the task Task ':app:extractDebugPythonBuildPackages' is not up-to-date because: Task has failed previously. Starting process 'command 'C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beeware-venv\Scripts\python.exe''. Working directory: C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beewaretutorial\build\beewaretutorial\android\gradle\app Command: C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beeware-venv\Scripts\python.exe -m venv --without-pip C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beewaretutorial\build\beewaretutorial\android\gradle\app\build\python\env\debug Successfully started process 'command 'C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beeware-venv\Scripts\python.exe'' Starting process 'command 'C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beeware-venv\Scripts\python.exe''. Working directory: C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beewaretutorial\build\beewaretutorial\android\gradle\app Command: C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beeware-venv\Scripts\python.exe -Wignore -m compileall -qq C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beewaretutorial\build\beewaretutorial\android\gradle\app\build\python\env\debug Successfully started process 'command 'C:\Users\happy\Unsynced-Documents\BeeWareProjects\beeware-tutorial\beeware-venv\Scripts\python.exe'' > Task :app:extractDebugPythonBuildPackages FAILED

I've asked various AI sources for hours on how to fix the issue, but I never managed to reach the root of the problem. I've scanned through the error files and tried to understand what I could as best I can, but I couldn't find anything conclusive. Any help would be greatly appreciated.

I'm pretty confident this issue is related to the internal workings of building for android compared to my actual code (mainly because I could build for Windows), and also because I am not using any extra libraries besides Toga which is the default framework for BeeWare. I tried using python for android through buildozer with kivy in python and WSL before, but I encountered so many issues for so many hours that I ultimately abandoned it, so I'm not sure if maybe it's Windows or my computer specifically. Once again, all help is appreciated, and if you would like me to give any more details, I am more than willing to. I can't attach the full log (as a result of running briefcase build android -v) because of how verbose it is, but if there is something in specific you would like to see, I can add that in, as I understand it is a bit hard to debug with such little information.

Read Entire Article