Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug .uxml not found

Discussion in 'UI Toolkit' started by CoryMaklin, Sep 22, 2021.

  1. CoryMaklin

    CoryMaklin

    Joined:
    Oct 10, 2020
    Posts:
    29
    I have a .uxml file that contains other .uxml files as children.
    There have been multiple instances where the editor throws an exception out of the blue saying it can't find the .uxml files. I am then forced to re-add them and re-apply any styles.
     
  2. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    230
    Do you have more information on the error?

    My guess would be that maybe your project structure changed and assets are not recognized anymore.
    Were your assets using complete paths with ids, or just paths?
    What I mean by that is, did your templates look something like this? (see src="...")

    Code (CSharp):
    1. <ui:Template name="ButtonTemplate" src="project://database/Assets/Resources/ButtonTemplate.uxml?fileID=9197481963319205126&amp;guid=19b41fd426d854103932ea16dbf78d23&amp;type=3#ButtonTemplate" />
    2. <ui:Instance template="ButtonTemplate" name="ButtonTemplate" />
    3.  
    If they didn't look like this, and were simple paths, it is possible that if your assets moved in the project, their link was broken.
    This way of storing templates was recently added, so it also depends on which version you are using.
     
    Last edited: Sep 23, 2021
  3. CoryMaklin

    CoryMaklin

    Joined:
    Oct 10, 2020
    Posts:
    29
    It appears that I'm just using paths as opposed to complete paths with ids.
    Code (CSharp):
    1. <ui:Template name="Equipment" src="Equipment/Equipment.uxml" />
    I'm using Unity version 2021.1.21f, and the package version preview.17.
     
  4. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    230
    Ok, that means if your project structure changed, you're most likely going to have these missing file errors.
    With package preview.17, you should have access to the new mechanism, so you can probably simply open your uxml files in the builder and save them to start using the new, location-independent, source format.