Search Unity

Bug Cannot build: Fail to copy UIElementsModule

Discussion in 'UI Toolkit' started by Shinyclef, Nov 29, 2020.

  1. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Hello,

    I'm experiencing a bug every time I build. The build completes and the log says build completed with result 'succeeded' but then in the copy files phase the following errors occur and the remainder of files are not copied.

    Happened on b11, tried updating to b13 and it still happened. Also tried deleting the build and library folders before a rebuild, reimporting the UIElements package an restarting unity. I'm on mono, not IL2CPP just cause IL2CPP takes years to build.

    Any ideas? Or am I just going to have to wait a few versions of unity/packages until it resolves?

    Cheers.

    Code (CSharp):
    1. Fail to copy Temp/UnityEngine.UIElementsModule.dll or Temp/UnityEngine.UIElementsModule.pdb to Library/ScriptAssemblies before post processing the assembly. Skipping post processing.
    2. System.IO.IOException: Win32 IO returned 1224. Path: Temp/UnityEngine.UIElementsModule.dll" or "Library/ScriptAssemblies/UnityEngine.UIElementsModule.dll
    3.   at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00192] in <9577ac7a62ef43179789031239ba8798>:0
    4.   at UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll () [0x001e8] in <5ef0d2af5a0949e48cdb0899c171db88>:0
    5. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,string[])
    Code (CSharp):
    1. Fail to copy Temp/UnityEditor.UIElementsModule.dll or Temp/UnityEditor.UIElementsModule.pdb to Library/ScriptAssemblies before post processing the assembly. Skipping post processing.
    2. System.IO.IOException: Win32 IO returned 1224. Path: Temp/UnityEditor.UIElementsModule.dll" or "Library/ScriptAssemblies/UnityEditor.UIElementsModule.dll
    3.   at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00192] in <9577ac7a62ef43179789031239ba8798>:0
    4.   at UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll () [0x001e8] in <5ef0d2af5a0949e48cdb0899c171db88>:0
    5. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,string[])
     
    Last edited: Nov 29, 2020
  2. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    Hello,

    Are you using any DOTS related package?
     
  3. Dbgamerstarz

    Dbgamerstarz

    Joined:
    Jul 1, 2017
    Posts:
    3
    Hello, I've run into the same issue (using 2020.2.1f) and I'm using DOTS related packages

    Thanks!
     
  4. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    Yep. Same here.

    It doesnt actually seem to change anything but I dont use any post processing on my UI.
     
  5. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    I'm getting this bug as well. Any update on this?
     
  6. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Hello I'm sorry I forgot to watch this thread, my computer died, rebuilt a new one, lots happened!
    I am using hybrid renderer v2 and my project is ECS based.
    I'm now on 2020.2.f1. Now the behaviour is different, it builds without the error but the build crashes immediately.

    Suspecting UiElements, I did the following:
    - Backup my scene, delete every scene object, try again. -> Same behaviour, crash on build start up.
    - Remove the UI Elements and UI Toolkit packages, comment out references to the packages in my code, and rebuild. -> The build did NOT crash on startup (although runtimes errors occurred as expected from my code commenting).

    I do occasionally still get the 'cannot copy UI Elements' error in the editor log. This happens when I switch architectures in the Build Settings for example.
     
  7. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Ok, I reimported the two packages, and now the build is working.
    If anyone else is having this issue, try removing and re-adding both UI Elements and UI Toolkit packages.
     
  8. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    It looks like the issue comes back though. I switched to IL2CPP, build crash. Switched back to Mono, build crash. Switched back to IL2CPP and removed then reimported UI Elements and UI Builder packages, build works fine.
     
  9. ScallyGames

    ScallyGames

    Joined:
    Sep 10, 2012
    Posts:
    49
    This is an ongoing problem that prevents using UI Toolkit with DOTS projects due to not being able to build.

    Is there any solution or any information we could provide to speed up getting a fix?
     
    LudiKha likes this.
  10. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    I'm still getting this error, @Shinyclef or @Aides have you been able to get it to work?
     
  11. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    I'm not having this issue anymore. It might have been updating editor/package that fixed it.
    To be clear, occassionally I get some kind of UIElements error when I mess with the package upgrades/downgrades, but it's not persistent, I can just restart editor.

    I am on UI Builder 13 (14 caused me issues), UI Toolkit 14, Unity 2020.3.6f1.
    Unity 2021 has in build UI Toolkit (not package). I'd like to get onto that but unity team says I'm not allowed to upgrade if using Entities package so... yeah.
     
  12. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    377
    If you are able to get a consistent repro, could you submit a bug report so we can investigate? Go under Help->Report a bug... Thanks
     
  13. vildauget

    vildauget

    Joined:
    Mar 10, 2014
    Posts:
    121
  14. vildauget

    vildauget

    Joined:
    Mar 10, 2014
    Posts:
    121
    @AlexandreT-unity , have this been looked into? No word here, no word on the issue tracker . The combination of forcing ECS projects to downgrade to 2020 LTS and this problem to use UI Toolkit together with Hybrid renderer in 2020 LTS isn't ideal.

    Decided to give Unity Engine another chance today, but after polishing a new project it stopped hard here again as soon as I imported the first script.
     
  15. vildauget

    vildauget

    Joined:
    Mar 10, 2014
    Posts:
    121
    I solved my current issue by removing the package com.unity.ui, then adding the UI Builder package, then adding com.unity.ui again. Now I wonder if that was the cause all the way, and maybe other people as well.
     
  16. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    377
    We investigated the issue and assigned it to the proper team but they haven't had time to tackle it yet. I'm glad that you found a workaround! Note that starting with 21.2 (which was just released!), you don't need the package anymore, since UIToolkit runtime is now built into the engine. This avoids the package/assembly override mess.
     
    vildauget likes this.