kivy / python-for-android

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

Build fails, says I need to configure a larger heap for gradle #1327

Open ghost opened 6 years ago

ghost commented 6 years ago

I used this build command: p4a apk --debug --private /my-app/ --orientation user --window --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python3crystax,sdl2,pysdl2,pyjnius --arch=armeabi-v7a

It failed with a Java heap space error:

[INFO]:    Selecting java build tool:
[INFO]:    Detected highest available build tools version to be 28.0.1
[INFO]:        Building with gradle, as gradle executable is present
[DEBUG]:   -> running gradlew assembleDebug
[DEBUG]:    Downloading https://services.gradle.org/distributions/gradle-3.3-all.zip
[DEBUG]:    .........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
[DEBUG]:    Unzipping /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap/gradle-3.3-all.zip to /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap
[DEBUG]:    Set executable permissions for: /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap/gradle-3.3/bin/gradle
[DEBUG]:    Starting a Gradle Daemon (subsequent builds will be faster)
[DEBUG]:    > Configuring > 0/1 projects > root project > Compiling /root/.local/share/pDownload https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.1/gradle-2.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':class[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.3.1/gradle-core-2.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/builder/2.3.1/builder-2.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/lint/lint/25.3.1/lint-25.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':class[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/build/gradle-api/2.3.1/gradle-api-2.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/databinding/compilerCommon/2.3.1/compilerCommon-2.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/ow2/asm/asm/5.0.4/asm-5.0.4.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.4/asm-parent-5.0.4.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/ow2/1.3/ow2-1.3.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/ow2/asm/asm-commons/5.0.4/asm-commons-5.0.4.pom
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.3.2/proguard-gradle-5.3.2.pom
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/proguard/proguard-parent/5.3.2/proguard-parent-5.3.2.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/jacoco/org.jacoco.core/0.7.5.201505241946/org.jacoco.core-0.7.5.201505241946.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/jacoco/org.jacoco.build/0.7.5.201505241946/org.jacoco.build-0.7.5.201505241946.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/jacoco/org.jacoco.report/0.7.5.201505241946/org.jacoco.report-0.7.5.201505241946.pom
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/google/protobuf/protobuf-parent/3.0.0/protobuf-parent-3.0.0.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/google/google/1/google-1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/antlr/3.5.2/antlr-3.5.2.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/antlr-master/3.5.2/antlr-master-3.5.2.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/builder-model/2.3.1/builder-model-2.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/build/builder-test-api/2.3.1/builder-test-api-2.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/sdklib/25.3.1/sdklib-25.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/sdk-common/25.3.1/sdk-common-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/common/25.3.1/common-25.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/build/manifest-merger/25.3.1/manifest-merger-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/25.3.1/ddmlib-25.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.13.0/jack-api-0.13.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.10.0/jill-api-0.10.0.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/analytics-library/protos/25.3.1/protos-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/analytics-library/shared/25.3.1/shared-25.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/analytics-library/tracker/25.3.1/tracker-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.4/asm-tree-5.0.4.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/lint/lint-checks/25.3.1/lint-checks-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.6.1/ecj-4.6.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/google/guava/guava-parent/18.0/guava-parent-18.0.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/databinding/baseLibrary/2.3.1/baseLibrary-2.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/antlr4/4.5.3/antlr4-4.5.3.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/antlr/antlr4-master/4.5.3/antlr4-master-4.5.3.pom
[DEBUG]:    Download https://jcenter.bintray.com/commons-io/commons-io/2.4/commons-io-2.4.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/apache/commons/commons-parent/25/commons-parent-25.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/apache/9/apache-9.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/annotations/24.5.0/annotations-24.5.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.3.2/proguard-base-5.3.2.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.1/asm-parent-5.0.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/ST4/4.0.8/ST4-4.0.8.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/25.3.1/layoutlib-api-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/dvlib/25.3.1/dvlib-25.3.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/repository/25.3.1/repository-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/commons/commons-parent/33/commons-parent-33.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':class[DEBUG]:    Download https://jcenter.bintray.com/org/apache/apache/13/apache-13.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/25.3.1/lint-api-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.4/asm-analysis-5.0.4.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/google/jimfs/jimfs-parent/1.1/jimfs-parent-1.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':class[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/commons/commons-parent/5/commons-parent-5.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':class[DEBUG]:    Download https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom
[DEBUG]:    Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/org/apache/commons/commons-parent/11/commons-parent-11.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/external/com-intellij/uast/162.2228.14/uast-162.2228.14.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
[DEBUG]:    > Configuring > 0/1 projects > root project > Resolving dependencies ':classDownload https://jcenter.bintray.com/com/android/tools/annotations/25.3.1/annotations-25.3.1.pom
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.1/gradle-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.3.1/gradle-core-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/builder/2.3.1/builder-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/lint/lint/25.3.1/lint-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/gradle-api/2.3.1/gradle-api-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/databinding/compilerCommon/2.3.1/compilerCommon-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-commons/5.0.4/asm-commons-5.0.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.3.2/proguard-gradle-5.3.2.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/jacoco/org.jacoco.core/0.7.5.201505241946/org.jacoco.core-0.7.5.201505241946.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/jacoco/org.jacoco.report/0.7.5.201505241946/org.jacoco.report-0.7.5.201505241946.jar
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/antlr/3.5.2/antlr-3.5.2.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/builder-model/2.3.1/builder-model-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/2.3.1/builder-test-api-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/sdklib/25.3.1/sdklib-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/sdk-common/25.3.1/sdk-common-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/common/25.3.1/common-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/25.3.1/manifest-merger-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/25.3.1/ddmlib-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.13.0/jack-api-0.13.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.10.0/jill-api-0.10.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/analytics-library/protos/25.3.1/protos-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/analytics-library/shared/25.3.1/shared-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/analytics-library/tracker/25.3.1/tracker-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.4/asm-tree-5.0.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/25.3.1/lint-checks-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.6.1/ecj-4.6.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/databinding/baseLibrary/2.3.1/baseLibrary-2.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/antlr4/4.5.3/antlr4-4.5.3.jar
[DEBUG]:    Download https://jcenter.bintray.com/commons-io/commons-io/2.4/commons-io-2.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.3.2/proguard-base-5.3.2.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/antlr/ST4/4.0.8/ST4-4.0.8.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/25.3.1/layoutlib-api-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/dvlib/25.3.1/dvlib-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/repository/25.3.1/repository-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/25.3.1/lint-api-25.3.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.4/asm-analysis-5.0.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
[DEBUG]:    Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/external/com-intellij/uast/162.2228.14/uast-162.2228.14.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar
[DEBUG]:    Download https://jcenter.bintray.com/com/android/tools/annotations/25.3.1/annotations-25.3.1.jar
[DEBUG]:    Incremental java compilation is an incubating feature.
[DEBUG]:    :preBuild UP-TO-DATE
[DEBUG]:    :preDebugBuild UP-TO-DATE
[DEBUG]:    :checkDebugManifest
[DEBUG]:    :prepareDebugDependencies
[DEBUG]:    :compileDebugAidl
[DEBUG]:    :compileDebugRenderscript
[DEBUG]:    :generateDebugBuildConfig
[DEBUG]:    :generateDebugResValues
[DEBUG]:    :generateDebugResources
[DEBUG]:    :mergeDebugResources
[DEBUG]:    :processDebugManifest
[DEBUG]:    :processDebugResources
[DEBUG]:    :generateDebugSources
[DEBUG]:    :incrementalDebugJavaCompilationSafeguard
[DEBUG]:    :javaPreCompileDebug
[DEBUG]:    :compileDebugJavaWithJavac
[DEBUG]:    :compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
[DEBUG]:    Note: Some input files use or override a deprecated API.
[DEBUG]:    Note: Recompile with -Xlint:deprecation for details.
[DEBUG]:    :compileDebugNdk UP-TO-DATE
[DEBUG]:    :compileDebugSources
[DEBUG]:    :mergeDebugShaders
[DEBUG]:    :compileDebugShaders
[DEBUG]:    :generateDebugAssets
[DEBUG]:    :mergeDebugAssets
[DEBUG]:    :transformClassesWithDexForDebug
[DEBUG]:    
[DEBUG]:    Running dex as a separate process.
[DEBUG]:    
[DEBUG]:    To run dex in process, the Gradle daemon needs a larger heap.
[DEBUG]:    It currently has 1024 MB.
[DEBUG]:    For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB.
[DEBUG]:    To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
[DEBUG]:    For more information see https://docs.gradle.org/current/userguide/build_environment.html
[DEBUG]:    
[DEBUG]:    :mergeDebugJniLibFolders
[DEBUG]:    :transformNativeLibsWithMergeJniLibsForDebug
[DEBUG]:    :transformNativeLibsWithStripDebugSymbolForDebug
[DEBUG]:    :processDebugJavaRes UP-TO-DATE
[DEBUG]:    :transformResourcesWithMergeJavaResForDebug
[DEBUG]:    :validateSigningDebug
[DEBUG]:    :packageDebug FAILED
[DEBUG]:    
[DEBUG]:    FAILURE: Build failed with an exception.
[DEBUG]:    
[DEBUG]:    * What went wrong:
[DEBUG]:    Execution failed for task ':packageDebug'.
[DEBUG]:    > Java heap space
[DEBUG]:    
[DEBUG]:    * Try:
[DEBUG]:    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[DEBUG]:    
[DEBUG]:    BUILD FAILED
[DEBUG]:    
[DEBUG]:    Total time: 42.575 secs
[DEBUG]:    
Exception in thread background thread for pid 1966:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /root/.local/share/python-for-android/dists/unnamed_dist_1/gradlew assembleDebug

I don't have any gradle properties or any config files, I just used the p4a command above - so I don't know how to fix this. Maybe, p4a could pick a better default here on its own?

ghost commented 6 years ago

Ok, I did some digging, and this fixes it:

export GRADLE_OPTS="-Xms1724m -Xmx5048m -Dorg.gradle.jvmargs='-Xms1724m -Xmx5048m'"

Maybe p4a could somehow make this default, without overriding it if already specified by the user? (for people who use their custom gradle settings with p4a)

AndreMiras commented 6 years ago

Good catch thanks! I've never seen this error before. For information, what's your distribution? If this error affects too many users we could also update the troubleshooting to begin with.

ghost commented 6 years ago

I ran it in a standard ubuntu:latest docker image (which seems to be 18.04 right now) with gradle and openjdk-8-jdk as packaged for that.

It only appeared once I had a tad more dependencies and might also depend on having larger project contents (I have about 200MB of files), so I imagine it potentially affects a lot of users, but in practice only a subset with particularly big projects maybe (?)

AndreMiras commented 6 years ago

Oh OK good to know, but weird, I remember I tried on Dockerized Ubuntu 18.04 and didn't see that specific issue. However it could be that gradle wasn't picked up in my case.

ghost commented 6 years ago

You'll probably get the 1024MB warning as well (check in your logs if you're curious, might require the debug output of p4a to be enabled) - but it only crashes if it actually runs out, which seems to require a certain project size and complexity. My earlier tests didn't crash either, but my current real world app does when packaged.

Non-gradle ant-based builds shouldn't actually work anymore, I tried those and all recent versions of Android SDKs have the required file removed (even of older SDKs, they updated them accordingly). Doesn't look like Google supports non-gradle builds these days

ghost commented 5 years ago

Oh right, I could actually add this to the options maybe. Or does this not affect anyone else? I wonder if my app is just too huge :joy:

inclement commented 5 years ago

I've seen maybe one other person hit this, I think, but it seems pretty rare. I don't see a reason not to add the proposed option though, if anyone wants to make a PR for it.

ghost commented 5 years ago

@inclement I think it'll increase the base memory footprint a little, so it's not entirely without cost