Could not move temporary workspace

build operation failed.

    Could not move temporary workspace (C:\Users\HP EliteBook\.gradle\caches\8.11.1\transforms\0877a7879cbf9348c34a6f1f84d6701c-1015d43e-96f4-4ee0-b104-ea90012e2bca) to immutable location (C:\Users\HP EliteBook\.gradle\caches\8.11.1\transforms\0877a7879cbf9348c34a6f1f84d6701c)
> Could not move temporary workspace (C:\Users\HP EliteBook\.gradle\caches\8.11.1\transforms\0877a7879cbf9348c34a6f1f84d6701c-1015d43e-96f4-4ee0-b104-ea90012e2bca) to immutable location (C:\Users\HP EliteBook\.gradle\caches\8.11.1\transforms\0877a7879cbf9348c34a6f1f84d6701c)

Please do not hijack totally unrelated topics with off-topic posts.

Also please at least do a minimal research before asking questions. Not doing so is one of the main characteristics of a help vampire. If you did, you would have found many threads regarding this issue here already and on the Gradle community slack and in the end the two issues "Immutable workspace contents have been modified" failure when workspace contents are not modified · Issue #28475 · gradle/gradle · GitHub and Temporary workspace cannot be moved to immutable location when files left open on Windows · Issue #27844 · gradle/gradle · GitHub so you probably need to downgrade Gradle or disable your anti-virus on those directories, or upgrade Gradle to latest version. See the issues for more information.

@Vampire Thanks for the clarification and for sharing the related issues.

Just to add some context from my side — the project is being worked on by two developers. While experimenting with a new feature locally, I changed some configurations which likely affected something in the local Gradle environment or .gradle caches. Since then I haven’t been able to run the app even in development mode, and every attempt to run the build results in the same error:

Execution failed for task ':app:checkDebugAarMetadata'.
Could not move temporary workspace ... to immutable location ...

Even after reverting my configuration changes, the problem persists, which makes me suspect it is related to the local Gradle cache state rather than the project configuration itself.

I did see the suggestions about downgrading or upgrading Gradle. My concern is that this is a shared project, and changing the Gradle version in the project configuration could affect the other developer who currently has a working setup. Because of that, I’m trying to be careful about modifying the Gradle version unless it’s clearly the recommended fix.

I’ll go through the linked issues you mentioned to see if clearing specific caches or addressing Windows file-locking (e.g., antivirus interference) resolves it locally without requiring a project-wide Gradle change.

Appreciate the pointers to those threads.