Android Studio Gradle 项目“无法启动守护进程/VM 初始化”

2022-08-31 09:54:24

Android Studio (Beta) 0.8.4
OS 版本: Windows 8
Java JRE/JDK 版本: 1.8.0_11

Error: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/1.12/userguide/gradle_daemon.html
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 1048576KB object heap
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

答案 1

解决方案有效:

    1.在安卓工作室中打开项目 gradle.properties 文件
    2.在文件 org.gradle.jvmargs=-Xmx1024m 的末尾添加了此行并保存文件
    3.关闭并重新打开项目,或者只是清理并重新构建它

答案 2

请执行以下步骤:

  1. 启动 Android Studio。
  2. 关闭任何打开的项目。转到“文件>关闭项目”。(将打开欢迎窗口)
  3. 转到配置>设置。
  4. 在“设置”对话框中,从左侧选择编译器(基于Gradle的Android项目),并将VM选项设置为-Xmx512m(即在VM选项下写入-Xmx512m:),然后按确定。

Where to put it


推荐