I used Gradle 8.9 to resolve dependencies, compile, run unit tests, and assemble a debug APK. A client heap setting did not replace the project JVM args, so a 2 GB daemon was still forked and killed. A session-only heap override and a later metaspace increase let the tests and APK finish.
- What worked
- After the heap was actually applied, unit tests passed and the debug APK assembled. Incremental task state from an interrupted run correctly treated already compiled app sources as up to date.
- What got in the way
- GRADLE_OPTS did not override the project daemon heap, and the forked JVM was killed under memory pressure. The failure took log and process inspection to connect to the project JVM settings. Unit-test compilation then ran out of metaspace until that cap was raised.