您的位置:首页 > 编程语言 > Java开发

Error:Error: Could not create the Java Error: A fatal exception has occurred. Program will exit.

2017-03-20 01:10 781 查看
最近使用Android Studio开发Android应用时,引用别人的工程,运行报错。出错信息如下:

Error:Error: Could not create the Java Virtual Machine.

Error:Error: A fatal exception has occurred. Program will exit.

Error:Invalid maximum heap size: -Xmx4g

Error:The specified size exceeds the maximum representable size.

Error:Execution failed for task ':app:transformClassesWithDexForWandoujiaDebug'.

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

于是各种百度,各种Google,改jvm参数,改studio参数,



org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

改虚拟内存


还是一筹莫展。

后来发现Error:Invalid maximum heap size: -Xmx4g这句话,于是全局搜索4g于是在app/build.gradle中发现这句

dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}


于是果断把4g改为1g完美运行!!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐