link.xml file missing assembly full name after addressable build

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 :

<assembly>

<type preserve="nothing" fullname="package.DirectDamage" serialized="true"/>

<type preserve="nothing" fullname="package.ManaCost" serialized="true"/>

</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)

Note that the package.ManaCost and package.DirectDamage are struct that are referenced in the addressable asset through the serialized reference.

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 :

//Add serialize reference classes which are contained in other assemblies not yet removed.
            foreach (var k in m_SerializedClassesPerAssembly)
            {
                var assembly = linker.AppendChild(doc.CreateElement("assembly"));
                var attr = doc.CreateAttribute("fullname");
                attr.Value = k.Key;
                assembly.Attributes.Append(attr); // FIX IS HERE
                //Add content for this
                foreach (var t in k.Value)
                {


                    var typeEl = assembly.AppendChild(doc.CreateElement("type"));
                    var tattr = doc.CreateAttribute("fullname");
                    tattr.Value = t;
                    if (typeEl.Attributes != null)
                    {
                        typeEl.Attributes.Append(tattr);
                        var pattr = doc.CreateAttribute("preserve");
                        pattr.Value = "nothing";
                        typeEl.Attributes.Append(pattr);
                        var sattr = doc.CreateAttribute("serialized");
                        sattr.Value = "true";
                        typeEl.Attributes.Append(sattr);
                    }
                }

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.

2 Likes

We’re hitting this now as well in 2020.1.17
doesn’t seem to be an issue in 2020.1.14 though???

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 Unity Issue Tracker - Building IL2CPP build fails with the Localization package 0.10.0 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.

1 Like

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 tag does not have a full name parameter.

 <assembly>
    <type fullname="System.Boolean" preserve="nothing" serialized="true" />
  </assembly>

Since issue is still present, I updated the thread title to mark it as BUG.
pinging @unity_bill again.

I’ll raise this with the team!

1 Like

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.

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?

Version 1.16.19 should be compatible with 2021.1: https://docs.unity3d.com/2021.1/Documentation/Manual/com.unity.addressables.html

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.

Have you tried manually editing the package.json file of you project ?