I am making a new project in Android Studio, but I have a problem when it is syncing gradle for the first time and I can’t do anymore.
I get these error messages:
FAILURE: Build failed with an exception.
* What went wrong:
java.io.UncheckedIOException: Could not move temporary workspace (C:UsersACERAndroidStudioProjectsCamaraX.gradle8.6dependencies-accessorsdcbcd87108cec70bb467e05d5172bee8efb944af-0241f059-0743-498d-b994-7c82e3b551d2) to immutable location (C:UsersACERAndroidStudioProjectsCamaraX.gradle8.6dependencies-accessorsdcbcd87108cec70bb467e05d5172bee8efb944af)
> Could not move temporary workspace (C:UsersACERAndroidStudioProjectsCamaraX.gradle8.6dependencies-accessorsdcbcd87108cec70bb467e05d5172bee8efb944af-0241f059-0743-498d-b994-7c82e3b551d2) to immutable location (C:UsersACERAndroidStudioProjectsCamaraX.gradle8.6dependencies-accessorsdcbcd87108cec70bb467e05d5172bee8efb944af)
...
* Exception is:
java.lang.RuntimeException: java.io.UncheckedIOException: Could not move temporary workspace (C:UsersACERAndroidStudioProjectsCamaraX.gradle8.6dependencies-accessorsdcbcd87108cec70bb467e05d5172bee8efb944af-0241f059-0743-498d-b994-7c82e3b551d2) to immutable location (C:UsersACERAndroidStudioProjectsCamaraX.gradle8.6dependencies-accessorsdcbcd87108cec70bb467e05d5172bee8efb944af)
...
Caused by: java.io.UncheckedIOException: Could not move temporary workspace
...
Caused by: java.nio.file.AccessDeniedException
I tried switching to a newer version, but the same thing happens and with older versions I get this:
Minimum supported Gradle version is 8.6. Current version is 8.5.
Please fix the project's Gradle settings.
Change Gradle version in Gradle wrapper to 8.6 and re-import project
Open Gradle wrapper properties
Gradle Settings.
2
Answers
Have you installed any AI assistant plugins?
I installed Codeium and found that this directory is occupied by Codeium’s Language Server.
When I disabled it, there were no more errors.
I was running into this same issue, such a nightmare. I went into
/app/gradle/libs.versions.toml
and changed the agp version to8.3.0
and
/app/gradle/wrapper/gradle-wrapper.properties
and changed it to8.5
and this fixed all issues
I also followed what @user25096281 mentioned. I uninstalled Codeium and made a new project. It worked without issue. I then reinstalled and it was all good, for now