I found a post on the Unity forums but it didn't help me. https://forum.unity.com/threads/photon-unity-networking.101734/page-46#post-4747286
tobiass said: ↑
It's a case where Unity's stripping is over-eager. You can reign it in by modifying the link.xml file in your project to retain the class (or simply all of the Photon dll).
I'm using PUN 1.96 and I was unable to get this method to work. I opened the link.xml file,
added
<assembly fullname="Photon3DotNet">
<type fullname="ExitGames.Client.Photon.SocketTcpAsync" preserve="all"/>
</assembly>
and also tried
<assembly fullname="Photon3DotNet">
<type fullname="ExitGames.Client.Photon.SocketUdpAsync" preserve="all"/>
</assembly>
and
<assembly fullname="Photon3DotNet">
<type fullname="ExitGames.Client.Photon.SocketTcpAsync" preserve="all"/>
</assembly>
and
<assembly fullname="Photon3Unity3D">
<type fullname="ExitGames.Client.Photon.SocketTcpAsync" preserve="all"/>
</assembly>
and
<assembly fullname="Photon3Unity3D">
<type fullname="ExitGames.Client.Photon.SocketUdpAsync" preserve="all"/>
</assembly>
But I still get the exception
MissingMethodException: Constructor on type 'ExitGames.Client.Photon.SocketUdpAsync' not found.
at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder,
Setting the stripping level to "None" is not an option here since, according to unity documentation, "The Disabled option is not available when the IL2CPP scripting backend is selected because of the impact it has on build times." Low stripping does not fix the issue. I MUST use IL2CPP on some platforms since mono isn't allowed (xb1 for example).
At this time I am blocked. Is there any way around this limitation?