Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Can't build: IOException: Failed to Move File Classes.jar

Discussion in 'ARCore' started by Tarrag, Jul 18, 2018.

  1. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    37
    Hi friends,

    Hoping someone can help, it's been a week and I'm not winning this one. I'm trying to build in 2018.1/2018.2 Unity the SampleScene within ARFoundation (https://github.com/Unity-Technologies/arfoundation-samples) or a simple scene I make in 2018.2 where I installed packages ARFoundation and AR Core XR plugin.

    error -> IOException: Failed to Move File / Directory from 'Temp/StagingArea\android-libraries\UnityARCore\classes.jar' to 'Temp/StagingArea\android-libraries\UnityARCore\libs\classes.jar'.

    FYI I can build no problem ARCore SDK 1.3.0 and ARInterface examples.

    I can see classes.jar in the following folders. When Unity stops the build at the error I cannot see classes.jar in Temp/StagingArea\android-libraries\UnityARCore\ or Temp/StagingArea\android-libraries\UnityARCore\libs\
    - arfoundation-samples\Temp\StagingArea\android-libraries\arcore_client\libs
    - arfoundation-samples\Temp\StagingArea\android-libraries\google_ar_required\libs
    - arfoundation-samples\Temp\StagingArea\android-libraries\unityandroidpermissions\libs

    I've tried
    - imported GoogleARCore SDK for Unity 1.3.0 in the ARFoundation samples to try open HelloAR scene to no success and to test if PlayServicesResolver could help. (https://github.com/google-ar/arcore-unity-sdk/releases/tag/v1.3.0). Neither did.
    - added <uses-permission android:name="android.permission.CAMERA" /> to AndroidManifest.xml in my Plugins/Android directory
    - switched off antivirus
    - removed allowing files in folders to have contents indexed
    - provided admin rights to unity when running it

    I've tested in Unity 2018.2, 2018.1.6f1, 2018.1.1 and prior versions that didn't work either. I run Build System Internal, min API 7.0 target highest installed, no multithreading or gpu skinning, and company.productname filled in. Error occurs both for development and non-development builds.

    Thanks a lot for your help! Sergio
    Unity console full error:

    IOException: Failed to Move File / Directory from 'Temp/StagingArea\android-libraries\UnityARCore\classes.jar' to 'Temp/StagingArea\android-libraries\UnityARCore\libs\classes.jar'.
    UnityEditor.FileUtil.MoveFileOrDirectory (System.String source, System.String dest) (at C:/buildslave/unity/build/Editor/Mono/FileUtil.bindings.cs:76)
    UnityEditor.Android.PostProcessor.Tasks.ProcessAAR.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:285)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: Jul 18, 2018
  2. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    180
    Have you tried using the Gradle build system? I believe that is required to copy the jar files correctly.
     
    Tarrag likes this.
  3. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    37
    Thank you for the lead @timmunity ! I did test it but I couldn't build on an error with this and the other examples -> Could not update C:\Users\user\.gradle\caches\4.0.1\file-changes\last-build.bin (Access is denied) - so I had pushed for internal.

    I'm hoping google doesn't run out of hits digging this one like it did with the classes.jar error hehehe.
    Cheers, Sergio
     
  4. stephencoorey

    stephencoorey

    Joined:
    Mar 29, 2017
    Posts:
    10
    I had this same problem and selecting Gradle fixed it for me. Previously I have always been able to use Internal though.
     
    Tarrag likes this.
  5. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    37
    Hey all, quick update in case this can be helpful to anyone who had a similar problem.

    I followed cue from this forum and got gradle to work (Internal continues to fail on the same grounds). Gradle was giving me trouble https://stackoverflow.com/questions...adle-build-fails-last-build-bin-access-denied and resolved it by simply selecting the properties of the gradle folder in c and settings its Attributes to not read-only and unhide files.

    I wish I had looked into that before lol
    Cheers, Sergio