Why are my Gradle builds dying with exit-code 137?

后端 未结 9 2072
醉酒成梦
醉酒成梦 2020-12-07 23:48

I\'ve been trying to compile and test a large project to use Gradle. The test run fine until they die unexpectedly. I dug around and resources said that this is due to a mem

9条回答
  •  半阙折子戏
    2020-12-08 00:35

    If you are having trouble with this on CircleCi, where you are trying to run Robolectric Test

    I found the solution to my problems on their documentation page for android

    https://circleci.com/docs/2.0/language-android/

    which was simply to add

    android {
        testOptions {
            unitTests {
                returnDefaultValues = true
                includeAndroidResources = true
    
                all {
                    maxHeapSize = "1024m"
                }
            }
        }
    

    If you are still running into OOM issues you can also limit the max workers for gradle: ./gradlew test --max-workers 4

提交回复
热议问题