Reputation: 665
I am trying to build in Unity its ARFoundations AR example for ARCore (https://github.com/Unity-Technologies/arfoundation-samples) using Unity's Gradle build option but fails as shown below.
C:\Users\user\.gradle\caches\4.0.1\file-changes\last-build.bin (Access is denied)
I don't know much android studio, can you please give me guidance what this may relate to?
Thanks a bunch for your help , Sergio
My setup:
Error: CommandInvokationFailure: Gradle build failed. C:\Program Files (x86)\Java\jdk1.8.0_172\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx1024m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
What went wrong: Could not update C:\Users\user.gradle\caches\4.0.1\file-changes\last-build.bin
C:\Users\user.gradle\caches\4.0.1\file-changes\last-build.bin (Access is denied)
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 45s ]
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Upvotes: 0
Views: 3343
Reputation: 6693
Go C:\Users\user and remove from hidden .gradle folder by right click. Also Go security and apply all permisions
Upvotes: 0
Reputation: 665
quick update in case this can be helpful to anyone who had a similar problem.
resolved it by simply selecting the properties of the gradle folder in c directory and settings its Attributes to not read-only and unhide files.
Cheers, Sergio
Upvotes: 1