ionic android build - 没有足够的内存来启动jvm [英] ionic android build - not enough memory to start jvm

查看:32
本文介绍了ionic android build - 没有足够的内存来启动jvm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用 ionic 和 gradle 创建 android apk 文件时,出现错误

When trying to create an android apk file using ionic and gradle, i get an error

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2
.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

D:	estplatformsandroidcordova
ode_modulesqq.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c "D:	estplatformsandroidgradle
w cdvBuildDebug -b D:	estplatformsandroiduild.gradle -Dorg.gradle.daemon=tr
ue"
ERROR building one of the platforms: Error: D:	estplatformsandroidcordovau
ild.bat: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: D:	estplatformsandroidcordovauild.bat: Command failed with exit cod
e 1
    at ChildProcess.whenDone (C:Users9923AppDataRoaming
pm
ode_modulescor
dova
ode_modulescordova-libsrccordovasuperspawn.js:131:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

我正在尝试在 Windows 7 桌面上执行此操作.我的 Java 内存设置如下.

I am trying to do this on a Windows 7 Desktop. My Java memory settings is as below.

D:	est>java -XX:+PrintFlagsFinal -version | findstr /i "HeapSize PermSize Threa
dStackSize"
     intx CompilerThreadStackSize                   = 0               {pd produc
t}
    uintx ErgoHeapSizeLimit                         = 0               {product}
    uintx HeapSizePerGCThread                       = 87241520        {product}
    uintx InitialHeapSize                          := 67108864        {product}
    uintx LargePageHeapSizeThreshold                = 134217728       {product}
    uintx MaxHeapSize                              := 1044381696      {product}
     intx ThreadStackSize                           = 0               {pd produc
t}
     intx VMThreadStackSize                         = 0               {pd produc
t}
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

我尝试在很多地方设置 -Xms-Xmx,但系统无法启动它.我该如何解决这个问题?

I tried setting -Xms and -Xmx at numerous places, but the system is just not able to start it. How do i solve this problem?

我改变了

在我的电脑">属性">环境变量
中添加了JAVA_OPTS在android SDK
dx.bat中添加了JAVA_OPTS在应用程序文件夹内的 build.bat 中添加了 JAVA_OPTS
更改了 gradle.properties

Added JAVA_OPTS in My Computer > Properties > Environment Variables
Added JAVA_OPTS in dx.bat in android SDK
Added JAVA_OPTS in build.bat inside application folder
Changed JAVA_OPTS in gradle.properties

请帮忙

推荐答案

发现此问题是特定于环境的.发布答案只是为了帮助那些可能遇到这个不幸问题的人.

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

问题通过在64位上安装32位JDK解决视窗 7.

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

安装前

  1. 转到应用程序管理器,删除所有 JRE 和 JDK 安装
  2. 删除与旧 Java 安装相关的所有环境变量
  3. 从 Path 变量中更新/删除所有与 Java 相关的条目.(不要删除路径变量)
  4. 重启系统
  5. 安装下载的JDK
  6. 转到环境变量并添加所需的键
  7. 更新 Path 变量以包含 JDK bin 文件夹

我不知道为什么会发生这种情况,但问题已解决.

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

这篇关于ionic android build - 没有足够的内存来启动jvm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆