Android studio Android studio,最大堆大小无效

Android studio Android studio,最大堆大小无效,android-studio,jvm,heap-size,Android Studio,Jvm,Heap Size,在项目清理和构建成功后。 我在安卓工作室运行安卓项目,下面出现错误,谁能给我解决问题的方案,谢谢!: > 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

在项目清理和构建成功后。 我在安卓工作室运行安卓项目,下面出现错误,谁能给我解决问题的方案,谢谢!:

> 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
我的android studio配置(studio.exe.vmoptions):


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

dexOptions {
    javaMaxHeapSize "4g"
}

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

dexOptions {
    javaMaxHeapSize "4g"
}

我遇到了同样的问题,这个答案帮助了我:我遇到了同样的问题,这个答案帮助了我: