Sergio Solorzano
Sergio Solorzano

Reputation: 665

Unity ARFoundation Gradle build fails - last-build.bin access denied

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.

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.

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

Answers (2)

Rajesh N
Rajesh N

Reputation: 6693

Go C:\Users\user and remove from hidden .gradle folder by right click. Also Go security and apply all permisions

Upvotes: 0

Sergio Solorzano
Sergio Solorzano

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

Related Questions