Travis CI: org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

Increasing the testkit daemon’s max heap size helped in my case (though I don’t really understand why…).
See TestKit: How to turn off daemon?