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
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