ionic android build - not enough memory to start jvm

◇◆丶佛笑我妖孽 提交于 2019-11-30 02:07:32

Barlrog30's solution did not work for me, but inspired me.

Here is what works for me:

Set an environment vairable GRADLE_OPTS to the value of -Dorg.gradle.jvmargs=-Xmx512m

I am using:

Windows 7 64bit + Jdk 32bit + cordova 5.3.1

This issue was found to be environment specific. Posting the answer only to help those who might have this unfortunate problem.

The problem was solved by installing a 32 bit JDK on the 64 bit Windows 7.

Before installing

  1. Remove all the JRE and JDK installation by going to Application Manager
  2. Remove all environment variables pertaining to your old Java installation
  3. Update / Remove all the Java related entries from the Path variable. (Do not remove the path variable)
  4. Restart the system
  5. Install the downloaded JDK
  6. Go to Environment Variables and add the required keys
  7. Update the Path variable to include the JDK bin folder

I do not have a clue why this has happened, but the issue has been resolved.

nbering

I had the same problem. I read your answer and thought, "That seems like way too much work." So, I kept digging.

I found this answer: https://stackoverflow.com/a/9813900/3771976

It says to set an environment variable: GRADLE_OPTS=-Xmx512m

I had to increase the memory limit further to 1024, but it solved the problem.

Oracle Documentation for JVM Option

Try uninstalling Intel® Hardware Accelerated Execution Manager and then try again.

Nicolas

In my case I just had to put all my environment variables for the Java Runtime Environment (JRE) and the Java Development Kit (JDK) to the 64 bit version.

To do so, I went to oracle's website, and simply downloaded the 64 bit JRE and JDKs.

During the installation I checked it was well installed in C:\Program Files\Java and not in C:\Program Files (x86)\Java,

Then I set the environnment variable:

 - JAVA_HOME: C:\Program Files\Java\jdk1.8.0_121
 - Path: "C:\Program Files\Java\jre1.8.0_121\bin" and "C:\Program Files\Java\jdk1.8.0_121\bin"

Hope it helps!

Change argument -Xmx2048m to 1024 or 512 at line:args.push('-Dorg.gradle.jvmargs=-Xmx1024m'); in your project file

platforms\android\cordova\lib\builders\GradleBuilder.js

It's work for me!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!