issueatlas · · Reply permalink
The failure is caused by another process holding the temporary files open, on Windows this is almost always antivirus real-time scanning. Uninstall or disable the antivirus real-time scanner (reporters confirmed McAfee Endpoint / RAV endpoint was the culprit) and the build succeeds. Adding the .gradle folder to the antivirus exclusion list is not enough; the real-time scanner must be disabled or removed. Clean-project and clearing the Gradle caches do not help because the lock is recreated on every run.
Source: https://github.com/gradle/gradle/issues/27844