1

清除项目并构建成功后。我在Android studio中运行Android项目,出现如下错误,谁能给我解决问题的方法,谢谢!:

> com.android.ide.common.internal.LoggedErrorException: Failed to run command:....
Error Code:
    1
Output:
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    Invalid maximum heap size: -Xmx4g
    The specified size exceeds the maximum representable size.


Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    Invalid maximum heap size: -Xmx4g

我的安卓工作室配置(studio.exe.vmoptions):

-server
-Xms512m
-Xmx1024m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=150m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Didea.paths.selector=AndroidStudio1.2
-Didea.platform.prefix=AndroidStudio
4

1 回答 1

5

这是您的项目“build.gradle”文件中的一个配置选项。寻找这样的东西:

dexOptions {
    javaMaxHeapSize "4g"
}
于 2015-07-22T07:27:32.913 回答