Buildozer fails to build apk - Error: Cannot allocate memory

144 views
Skip to first unread message

Roby Zaffa

unread,
Oct 10, 2022, 7:58:16 PM10/10/22
to Kivy users support
I'm trying to build an APK using Kivy and Buildozer, and when I run "buildozer android debug" I receive this error as a response:


#[DEBUG]:        **> Task :**mergeDebugAssets FAILED****
#[DEBUG]:       ERROR:Resource and asset merger: 1 exception was raised by workers:
#[DEBUG]:        A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$RunnableWrapperWorkAction
#[DEBUG]:     Cause 1: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$RunnableWrapperWorkAction
#[DEBUG]:                at org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:339)

...omissis...

#[DEBUG]:        FAILURE: Build failed with an exception. [DEBUG]:
#[DEBUG]:        * What went wrong: [DEBUG]:        Execution failed for task ':mergeDebugAssets'.
#[DEBUG]:        > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$RunnableWrapperWorkAction
#[DEBUG]:           > java.nio.file.FileSystemException: /home/zaffa/myapp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp/src/main/assets/private.tar
-> /home/zaffa/myapp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp/build/intermediates/assets/debug/mergeDebugAssets/private.tar:
****Cannot allocate memory****

Here memory status:
              total        used        free      shared  buff/cache   available
Mem:        4192692     2274080     1689260       17720      229352     1784880
Swap:      12582912      231200    12351712

I'm running Ubuntu 18.04.5 LTS on Windows 10 WSL 1 and bulldozer.spec is the default.

main.py it's very simple "Hello World" script.


I tried removing WSL and reinstalling everything from scratch but the errors are always the same. Can someone help me? Thank you  

Full log at: https://pastebin.com/q8U66NQa

  

Robert

unread,
Oct 10, 2022, 9:51:10 PM10/10/22
to Kivy users support
Key point : no idea, but I'd suspect the environment.

For unrelated reasons it is probably important to upgrade to wsl2 https://github.com/Android-for-Python/Android-for-Python-Users#usrbingzip-1-elf--not-found

I'd also suggest upgrade to Ubuntu 20 or 22 https://github.com/kivy/buildozer/blob/master/docs/source/installation.rst#android-on-ubuntu-2004-and-2204-64bit

There is one similar too terse error report that is also Win 10 https://github.com/kivy/buildozer/issues/1504 No way to know if this is related.

It is possible the newer versions of Gradle use more memory, so you could try messing with this https://learn.microsoft.com/en-us/windows/wsl/wsl-config but that might just be postponing the inevitable. No way to know.
Reply all
Reply to author
Forward
0 new messages