WebGL Stripping Rules

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.

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

1 Like

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.