我已经在android studio 2新版本上启动了一个新项目。然后显示“错误:无法启动守护进程。”这些行显示出来。
然后我通过添加此行来更改我的Gradle属性
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
但是,当我开始一个新项目时,此行再次出现:
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
https://docs.gradle.org/2.14.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 1572864KB object heap
我如何永久设置Gradle属性以避免每次发生这种情况。
最佳答案
打开位于androidStudio/bin/studio.vmoptions
的文件
它应该看起来像这样,如果不作相应更改
#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/configuration
#
-Xms256m
-Xmx1280m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
.......
这很可能会解决您的问题。
关于android - Android Studio中重复gradle属性错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40786623/