Parsers and serializers being stripped out due to bytecode stripping

Issue #84 resolved
Hertzole created an issue

As the title says, the Quantum parsers are getting stripped out when using bytecode stripping, resulting in an error: "Could not add 'command' from 'class' to the table as it is not supported. Parameter type System.Int32 is not supported by the Quantum Parser."

Serializers are also being stripped out so it always results in using ToString on return values and giving “not so pretty” results.

A temporary workaround is to add ‘[assembly: Preserve]’ to any class in the ‘QFSW.QC.Serializers’ assembly and ‘QFSW.QC.Parsers’ assembly.

I’ve used the High level stripping when this occurred. It happens on both IL2CPP and Mono when stripping is enabled.

Comments (4)

  1. Yusuf Ismail repo owner

    An alternative fix to [assembly: Preserve] that does not require to edit the project is as follows

    Create a file anywhere in your project called link.xml with the following contents

    <linker>
           <assembly fullname="QFSW.QC.Parsers" preserve="all"/>
           <assembly fullname="QFSW.QC.Grammar" preserve="all"/>
           <assembly fullname="QFSW.QC.Serializers" preserve="all"/>
    </linker>
    

    This will be fixed properly in V2.3.1

  2. Yusuf Ismail repo owner

    This is now fixed in V2.3.1 with the following link.xml

    <linker>
           <assembly fullname="QFSW.QC" preserve="all"/>
           <assembly fullname="QFSW.QC.Parsers" preserve="all"/>
           <assembly fullname="QFSW.QC.Grammar" preserve="all"/>
           <assembly fullname="QFSW.QC.Serializers" preserve="all"/>
           <assembly fullname="QFSW.QC.Extras" preserve="all"/>
    </linker>
    
  3. Log in to comment