Skip to content
This repository was archived by the owner on Apr 11, 2022. It is now read-only.
This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Can not build apk because of insufficient Java Heap Space. #813

@qroft

Description

@qroft

I can not create my app as it contains thousands (!) of images (approx. 2.8GB in total ) and the build process stops by informing me that it has a Java Heap Space problem.
For the last days i have read everything about Java Heap Space and added several gradle.properties files to my projcect's root, sub folder Android etc. but the strange thing is that even with these files inside, the Phonegpa ClI shows me this info:

Running command: cmd "/s /c "C:\phonegaps\remgif\platforms\android\gradlew.bat cdvBuildRelease -b C:\phonegaps\remgif\platforms\android\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m""

So even if i change the Xmx to 4g (my PC has 8 GB of RAM), the command "phonegap build -release android -d" always seems to use the 2048MB

As soon as i delete three folders with hundreds of images inside, the APK is created.
So i am wondering is this is a RAM or APK max size problem !?

PhoneGap CLI, node & npm versions

Phonegap 8.2.2.
Node 8.11.3
NPM 6.10.0

Expected Behaviour

APK gets build

Actual Behaviour

Build stopped due to "Java Heap Space" fail

Steps to Reproduce

phonegap build -release android

Sample Code that illustrates the problem

n.A.

Error messages

  • What went wrong:
    Execution failed for task ':app:packageRelease'.

Java heap space

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions