`flutter build apk --debug --no-pub` spawns a Gradle daemon whose journal
cache lock file lives on the persistent Dagger `gradle-cache` mount. When
the WithExec finishes, Dagger tears the container down and force-kills the
daemon, but the lock file remains with its now-dead PID. The next exec —
`./gradlew --no-daemon app:assembleAndroidTest` — then times out after 60s
waiting for that stale lock, failing the Firebase Test Lab build with:
> Timeout waiting to lock journal cache (/home/ci/.gradle/caches/journal-1).
It is currently in use by another process.
Owner PID: 88
Our PID: 53
The existing `--no-daemon` on the second exec only prevented daemon-registry
reuse, not stale lock files. Chain `./gradlew --stop` into the first exec so
the daemon shuts down gracefully and releases its locks before Dagger
snapshots the layer.
Closes#549
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>