gad*_*fil 9 android gradle android-studio
从版本1.3开始,Android Studio将不再支持特定于IDE的Gradle JVM参数设置.需要在gradle.properties文件中设置Gradle JVM设置.无论构建执行的位置如何(IDE,命令行或CI服务器),此更改都是保持构建输出一致所必需的.如果您的项目使用特定于IDE的Gradle JVM参数,则Android Studio将在项目同步时帮助您复制这些设置到项目的gradle.properties文件中."Gradle"设置页面中的"Gradle VM options"文本字段也已删除.
我收到错误:
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/2.4/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.
Run Code Online (Sandbox Code Playgroud)
我的gradle.properties文件
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
Run Code Online (Sandbox Code Playgroud)
尝试将 jvmargs 更改为以下内容
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Run Code Online (Sandbox Code Playgroud)
或者更小的-Xmx512m,因为您的系统没有足够的内存来创建对象堆,从而创建 jvm。
您还可以添加以下选项:
org.gradle.daemon=true
Run Code Online (Sandbox Code Playgroud)
对于 macOS 上的用户,我想添加以下内容
-Djava.awt.headless=true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4998 次 |
| 最近记录: |