Search Unity

Bug link.xml file missing assembly full name after addressable build

Discussion in 'Addressables' started by WAYNGames, Jan 16, 2021.

  1. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    Hello,

    I'm using the adressables for my porject and I managed to make it work after manually editing the link.xml in

    C:\Users\USER\Documents\GitHub\PORJECT\Library\com.unity.addressables\aa\Windows\AddressablesLink .

    Basically if I build the addressable and then try to build the porject using the scriptable built pipelin I get this error :

    Fatal error in Unity CIL Linker
    Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: C:\Users\USER\Documents\GitHub\PROJECT\Assets\StreamingAssets\aa\AddressablesLink\link.xml ---> System.ArgumentException: Name can not be empty

    If I look at the link.xml I have these line that trigger the error :

    Code (xml):
    1. <assembly>
    2.  
    3. <type preserve="nothing" fullname="package.DirectDamage" serialized="true"/>
    4.  
    5. <type preserve="nothing" fullname="package.ManaCost" serialized="true"/>
    6.  
    7. </assembly>

    I f I remove those lines, the build is successfull and everithing work as I expect.
    But as soon as I rebuild the addressables they are back...

    Any way to prevent this from beeing added to the link file (or fix the missing assembly name...)?

    I tryied to add a [preserve] attribute on the types and at assembly level but nothing works...


    EDIT : Updated to latest preview version but it did not solve the issue. (1.17.2-preview - January 15, 2021)
     
    Last edited: Jan 16, 2021
  2. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    Note that the package.ManaCost and package.DirectDamage are struct that are referenced in the addressable asset through the serialized reference.
     
  3. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    After some more investigation I figured the issue is in the package com.unity.scriptablebuildpipeline@1.15.1 "Editor\Utilities\LinkXMLGenerator.cs"

    From line 240 you add serialized reference types contianed in other assemblies. But when creating the assembly tag for the link.xml, you don't add it's attribute 'fullname" or rather, you don't set it's value.

    Here is the corrected code :

    Code (CSharp):
    1. //Add serialize reference classes which are contained in other assemblies not yet removed.
    2.             foreach (var k in m_SerializedClassesPerAssembly)
    3.             {
    4.                 var assembly = linker.AppendChild(doc.CreateElement("assembly"));
    5.                 var attr = doc.CreateAttribute("fullname");
    6.                 attr.Value = k.Key;
    7.                 assembly.Attributes.Append(attr); // FIX IS HERE
    8.                 //Add content for this
    9.                 foreach (var t in k.Value)
    10.                 {
    11.  
    12.  
    13.                     var typeEl = assembly.AppendChild(doc.CreateElement("type"));
    14.                     var tattr = doc.CreateAttribute("fullname");
    15.                     tattr.Value = t;
    16.                     if (typeEl.Attributes != null)
    17.                     {
    18.                         typeEl.Attributes.Append(tattr);
    19.                         var pattr = doc.CreateAttribute("preserve");
    20.                         pattr.Value = "nothing";
    21.                         typeEl.Attributes.Append(pattr);
    22.                         var sattr = doc.CreateAttribute("serialized");
    23.                         sattr.Value = "true";
    24.                         typeEl.Attributes.Append(sattr);
    25.                     }
    26.                 }
    After modifying this in a local copy of the package, the project built and ran as expected.

    I'm pinging @unity_bill as I don't know where or how to report such a bug.
     
    Last edited: Jan 16, 2021
    wzkiro and CDF like this.
  4. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    We're hitting this now as well in 2020.1.17
    doesn't seem to be an issue in 2020.1.14 though???
     
  5. ashwinFEC

    ashwinFEC

    Joined:
    May 19, 2013
    Posts:
    48
    Thanks, this fixed a problem I had if I included the Localization package with custom metadata and wanted to create a IL2CPP build. I have already send a bug report some time ago and they said it would be fixed in Addressables 1.17.6-preview https://issuetracker.unity3d.com/is...-with-custom-metadata-in-a-string-table-entry

    But I just tried the package and it still isn't fixed. So your fix will make due until there is an official fix.
     
    WAYNGames likes this.
  6. Muchaszewski

    Muchaszewski

    Joined:
    Sep 23, 2015
    Posts:
    15
    This still happens on 2020.2.7f1 with Addressables 1.17.6-preview and ScritablePipeline 1.16.1.

    For me, it's this that causes the error, since the <assembly> tag does not have a full name parameter.

    Code (xml):
    1.  <assembly>
    2.     <type fullname="System.Boolean" preserve="nothing" serialized="true" />
    3.   </assembly>
     
    Last edited: Mar 6, 2021
  7. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    Since issue is still present, I updated the thread title to mark it as BUG.
    pinging @unity_bill again.
     
  8. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    I'll raise this with the team!
     
    WAYNGames likes this.
  9. andymilsom

    andymilsom

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    294
    Hi, This is fixed in 1.17.8 of Addressables and not 1.17.6-preview

    We have had a dependency issue here, in that we fixed in it ScriptableBuildPipeline (1.16.2) at the time Addressables 1.17.6-preview was to be released. However Addressables has not been updated to use ScriptableBuildPipeline 1.16.2 until Addressables 1.17.8 (Which is released this week). I have changed the "fixed version" in our system, which hopefully should update the issue tracker soon.
     
  10. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    We're running into this issue, but we can't update as it seems the only version of Addressables available to our Unity version (2021.1.6) is 1.16.19.
    Did no other version made the jump to 2021?
     
  11. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
  12. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    Yes, it is. But we need the 1.17 version discussed above, or later, to fix the issue discussed in this thread.

    The page you're linking says that the other versions should be available for 2021.1, but they're not accesible from the package manager.
     
  13. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    Have you tried manually editing the package.json file of you project ?