Error java.lang.OutOfMemoryError: GC overhead limit exceeded

后端 未结 20 2338
攒了一身酷
攒了一身酷 2020-11-21 05:23

I get this error message as I execute my JUnit tests:

java.lang.OutOfMemoryError: GC overhead limit exceeded

I know what an OutOfMemo

20条回答
  •  执念已碎
    2020-11-21 05:44

    The following worked for me. Just add the following snippet:

    android {
            compileSdkVersion 25
            buildToolsVersion '25.0.1'
    
    defaultConfig {
            applicationId "yourpackage"
            minSdkVersion 10
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }
    dexOptions {
            javaMaxHeapSize "4g"
        }
    }
    

提交回复
热议问题