Search Unity

UI damaged after deleting Library folder (build on CI or local)

Discussion in 'UI Toolkit' started by JochenK, Sep 20, 2021.

  1. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Hi,

    after crating an UI with UIBuilder everything is fine, the build work properly fine, out of the Editor as well as from the console.

    But when I remove the "Library" folder, like in a CI, the build is also succsessful but the UI is no longer there or damaged (shrinked).

    In this state, I can not fix it in the Editor as well.

    Im am using:
    2020.3.17f1,
    UIToolkit 1.0.0.preview.17
    UIBuilder 1.0.0.preview.17
    VectorGraphics 2.0.0.preview.17

    Note: I reduced the sample to only one VisualElement in the tree, only inline style, no extern uss, no graphics or other elements. It seams to me that there is an underlaying mechanism working...

    What could it be and how to fix it?

    Thanks in advance for your help
    Jochen
     
  2. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Hi,

    Are there any other errors in the Editor.log file when the problem occurs?

    Also, does it only occur in CI? Some CI jobs run Unity with the -no-graphics command-line option, which is known to cause import issues with some SVG assets. This could be part of the problem.

    Can you share that sample?
     
  3. uMathieu

    uMathieu

    Unity Technologies

    Joined:
    Jun 6, 2017
    Posts:
    398
  4. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Thank you for answering.
    I attached the hole project and inside the zip the Editor.log. I can not say if the output points to a serious error, it does not look like to me...

    CI is independent of the behaviour. (We have explicid machines witch supports Unity-Build with GFX support.)
    It occurs just by starting the project in the Editor or in the build made from the Editor, local build via console or, in the end, via CI. So it seams to be something else.

    I removed the dependency to the Vectorgraphics-package but it does not affect the behaviour.

    However, I hope you can find some hints that helps to find the problem.

    Thank you.
     

    Attached Files:

  5. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
  6. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Sorry, I can not confirm this workaround.
    "Reimport" on the uxml has no effect (RM -> context menu -> Reimport).
    Did I missunderstand something?

    Thanks in advance
     
  7. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    But "Reimport" on the "UI Toolkit" package let the UI come back.

    I will see, if this is also a workaround for a liitle mor complex views.

    But my be you have another idea?
     
  8. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Hi, I ran your project here, can you try reimporting the Assets/UI Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss asset? I suspect this is what's up now, though it shouldn't be happening, I agree :confused:
     
  9. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Thanks for the answers and sorry, I did not recognice it until now.
    I will test it tomorrow and come back with the result.
     
  10. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Well, I can confirm that.
    One note: The UI was first displayed correctly after starting the game. Before that, the GameView was still corrupted.

    Thank you for your help!

    Is there a plan when it will be fixed?
     
  11. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Just to say we've been experiencing the same thing and use Create->UI Toolkit->Panel Settings Asset to force a reimport - I guess of UnityDefaultRuntimeTheme.tss
     
  12. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    We already have a fix being worked on, and an update of the package is planned for soon but we don't yet have a date. Thanks for confirming this fixed the problem!
     
  13. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Hi,
    I have an additional question on this task:
    I try to run this in my CI but I can not solve the problem well.

    At the moment I reimport the template and start the build in my code:
    Code (CSharp):
    1. ReImportAsset("UnityDefaultRuntimeTheme");
    2.  
    3. buildReport = BuildPipeline.BuildPlayer(GetEnabledScenes(), fixedBuildPath, buildTarget, buildOptions);
    (Note: ReImport() calls in the end AssetDatabase.ImportAsset())

    After running this I have to call the hole build call from the CI again to fix the bug. Only one call is not enough.
    I also tryed to call ReImport() and BuildPlayer() in the same script just another time but this seams to be a difference because it does not fix the bug?!

    What will be the correct way to call ReImportAsset() and BuildPlayer() in my build script?

    Thanks in advance
     
  14. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Hello, I'm not sure if there's a way to fix this yourself, sadly, but the good news is that a fixed version of the package is about to be published :)
     
  15. JochenK

    JochenK

    Joined:
    Jun 6, 2017
    Posts:
    9
    Good news! So I will stay with my workaround and look forward to the update.
    Thank you for answering and have a nice day.
     
  16. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    The version with the fix (preview.18) is out already! :D