Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Link.xml part of version control?

Discussion in 'Addressables' started by delexaet, Jan 19, 2022.

  1. delexaet

    delexaet

    Joined:
    Apr 14, 2016
    Posts:
    39
    Hey

    Simple question, what's best practice with this file in "Assets/AddressableAssetsData/Link.xml". Should the file be ignored or part of version control?

    Thanks
     
    Nit_Ram and v01pe_ like this.
  2. v01pe_

    v01pe_

    Joined:
    Mar 25, 2015
    Posts:
    71
    I wonder as well. It keeps appearing, but when I version it, it keeps disappearing. Haven't made out a pattern about this file's existence yet (other than related to addressable building), but think it should be ignored, since it's generated anyway?
     
    VenetianFox likes this.
  3. delexaet

    delexaet

    Joined:
    Apr 14, 2016
    Posts:
    39
    Bumping for direct answer from unity
     
  4. lucahorn

    lucahorn

    Joined:
    Jul 24, 2018
    Posts:
    1
    I'm wondering this as well, keeps popping up then disappearing. Should it be committed to VCS?
     
  5. fatso

    fatso

    Joined:
    Jul 21, 2006
    Posts:
    51
    I'd love an official answer from Unity too. My experience is that it is actively harmful to check link.xml in, as it seems to change when the platform is switched and cause problems loading the editor if there is a platform mismatch.

    Assuming this is correct, and this file is ephemeral and platform specific, it would be great to have it moved to Library or another top level folder which was entirely excluded from VCS, rather than requiring path specific ignores.

    EDIT: Something more complicated is hanging launch, I don't think it's only link.xml, so take my comment above with a grain of salt.
     
    Last edited: Jun 4, 2022
  6. ficky23

    ficky23

    Joined:
    Aug 30, 2019
    Posts:
    3
    Bump!
     
  7. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi all "Assets/AddressableAssetsData/link.xml" can be ignored. It's used to prevent Unity from stripping Addressables classes during a player build, but it should getting auto-created and deleted (see AddressablesPlayerBuildProcessor.cs for exact details) once the build ends.

    Unfortunately the link.xml file must be present in the Assets folder. But maybe we could make it more obvious that it is just a temporary file that can be deleted/ignored by putting it in a folder like "Assets/AddressableAssetsData/TempBuildFiles/link.xml" https://docs.unity3d.com/Manual/ManagedCodeStripping.html#LinkXMLAnnotation
     
    Last edited: Jun 8, 2022
    Nit_Ram, GazaG, Lion_C and 23 others like this.
  8. ficky23

    ficky23

    Joined:
    Aug 30, 2019
    Posts:
    3
    Thanks for the response!
     
    pillakirsten likes this.
  9. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    853
    Bumped across this today. Your suggestion makes perfect sense, please add it on the roadmap. Cheers!
     
    squiDan, andreiagmu and pillakirsten like this.
  10. uncolike

    uncolike

    Joined:
    Jan 17, 2020
    Posts:
    31

    I built and ran the project on an iPhone. It could run, even though there was a warning, "Addressables - Unable to load runtime data at location." After some research, I executed Addressables->Groups->Build->NewBuild->DefaultBuildScript to resolve it. After that, I built and ran the project again. The warning was gone, but the project only displayed the splash images and then went black. It seems the scene couldn't be loaded.
    If I delete /Assets/AddressableAssetsData/link.xml, /Library, and reopen the project, it can be build and run on an iPhone. And the warning "Addressables - Unable to load runtime data at location." again.
     
    xucian likes this.
  11. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    @uncolike Does the issue only occur on iPhone?

    The warning "Addressables - Unable to load runtime data at location" comes from the Addressables system failing to initialize. So it sounds like the project loads fine when the system is unused.

    If the first scene is not addressable it should be getting loaded. You could try to make sure that Addressables system initialization succeeds (Addressables.InitializeAsync) before loading any assets. Then it should be easier to determine what is causing the freeze.
     
    xucian likes this.