kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.33k stars 1.84k forks source link

`gradle` and java increase RAM with each build #2632

Open Neizvestnyj opened 2 years ago

Neizvestnyj commented 2 years ago

Versions

The same is true when using ndk 19c, but less memory is consumed with each build.

buildozer.spec

android.api = 33 # 32
android.ndk = 23b
android.extra_manifest_application_arguments = ./android/extra_manifest_application_arguments.xml
android.gradle_dependencies = <dependencies>
android.enable_androidx = True
android.add_gradle_repositories = "mavenCentral()"
android.archs = arm64-v8a, armeabi-v7a
android.numeric_version = 7115
p4a.branch = develop
p4a.source_dir = ../python-for-android # from develop branch
p4a.bootstrap = sdl2

logs after 5 big app build:

[DEBUG]:        
[DEBUG]:        > Task :packageDebug FAILED
[DEBUG]:        
[DEBUG]:        FAILURE: Build failed with an exception.
[DEBUG]:        
[DEBUG]:        * What went wrong:
[DEBUG]:        Execution failed for task ':packageDebug'.
[DEBUG]:        > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
[DEBUG]:           > java.lang.OutOfMemoryError (no error message)
[DEBUG]:   
[DEBUG]:        * Try:
[DEBUG]:        > Run with --stacktrace option to get the stack trace.
[DEBUG]:        > Run with --info or --debug option to get more log output.
[DEBUG]:        > Run with --scan to get full insights.
[DEBUG]:   
[DEBUG]:        * Get more help at https://help.gradle.org
[DEBUG]:   
[DEBUG]:        Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

After first main app build

2022-07-02_13-40-09

Each subsequent assembly takes up RAM: + 100Mb in RAM

Build test app + main app

2022-07-02_14-01-17

buildozer android clean and deleting .gradle in home folder - does not help

When I use old p4a version (with ndk 19c) and build app twice.

2022-07-02_13-34-44

pkill -9 -e -f java - solve issue

Sahil-pixel commented 2 months ago

I have same issue