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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

WebGL Stripping Rules

Discussion in 'Unity 5 Pre-order Beta' started by Evgeny_Eliseev, Nov 27, 2014.

  1. Evgeny_Eliseev

    Evgeny_Eliseev

    Joined:
    Jul 7, 2014
    Posts:
    3
    We are using a library by reflection.
    Looks like webgl-exporter strips whole library out. [I can find a method by reflection only if there is the call of this method somewhere in the code]

    I found "il2cpp_required_link.xml" in il2cpp folder but I don't know syntax for this file
    + there are warning: "Don't reference anything other than mscorlib in this file".

    Is there are possibility to define what classes are need to preserve in right way?

    In Player Settings "Stripping Level" is "Disabled" but it doesn't help.
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Why do you need to call your library by reflection only? The cleanest fix would be to change that (or even to add fake references to it, to avoid the stripper).

    Stripping Level in Player Settings only affects stripping of engine code - managed code will always be stripped (if we didn't do that, resulting builds would be too huge to be usable.

    There is indeed a stripping whitelist xml, but it's not the file you quoted, but rather "
    Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml". But I'd avoid modifying that if the problem can be solved differently (by adding references to the classes you need to preserve in your code).
     
    made-on-jupiter likes this.
  3. Evgeny_Eliseev

    Evgeny_Eliseev

    Joined:
    Jul 7, 2014
    Posts:
    3
    Simply stated, our app makes requests to the server and get some commands for executing on the client. Executing is done via reflection.

    I'll try this.