PUN throws errors in clean build. The question was asked in October 2020. No one answered.

Options
Hi!

In October 2020, I asked a question to which I still have not received any answer.

The error only appears in build. I can't set a break in debug.
https://forum.photonengine.com/discussion/17117/the-error-only-appears-in-build-i-cant-set-a-break-in-debug#latest

The question is still actual for me.

PUN stops working correctly and starts throwing errors in the build without the Development Build check mark.
AA.png

If the Development Build checkbox is enabled, then everything is fine.
BB.png

Errors:
NullReferenceException: Object reference not set to an instance of an object.
  at PhotonSerialization_PlayerDressItems.Serialize (System.Object obj) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Diagnostics.Tracing.EnumHelper`1+Transformer`1[UnderlyingType,ValueType].Invoke (ValueType value) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteCustomType (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteObjectArray (ExitGames.Client.Photon.StreamBuffer stream, System.Collections.IList array, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteHashtable (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteParameterTable (ExitGames.Client.Photon.StreamBuffer stream, ExitGames.Client.Photon.ParameterDictionary parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.PeerBase.SerializeOperationToMessage (System.Byte opCode, ExitGames.Client.Photon.ParameterDictionary parameters, ExitGames.Client.Photon.EgMessageType messageType, System.Boolean encrypt) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.PhotonPeer.SendOperation (System.Byte operationCode, ExitGames.Client.Photon.ParameterDictionary operationParameters, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Realtime.LoadBalancingPeer.OpRaiseEvent (System.Byte eventCode, System.Object customEventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Realtime.LoadBalancingClient.OpRaiseEvent (System.Byte eventCode, System.Object customEventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonNetwork.RaiseEventInternal (System.Byte eventCode, System.Object eventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonNetwork.RPC (Photon.Pun.PhotonView view, System.String methodName, Photon.Pun.RpcTarget target, Photon.Realtime.Player player, System.Boolean encrypt, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonNetwork.RPC (Photon.Pun.PhotonView view, System.String methodName, Photon.Pun.RpcTarget target, System.Boolean encrypt, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonView.RPC (System.String methodName, Photon.Pun.RpcTarget target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at PhotonRPCController.Update () [0x00000] in <00000000000000000000000000000000>:0

or
NullReferenceException: Object reference not set to an instance of an object.
  at PhotonSerialization_PlayerPlayItemStaticMagic.Serialize (System.Object obj) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Diagnostics.Tracing.EnumHelper`1+Transformer`1[UnderlyingType,ValueType].Invoke (ValueType value) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteCustomType (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteObjectArray (ExitGames.Client.Photon.StreamBuffer stream, System.Collections.IList array, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteHashtable (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.Protocol18.WriteParameterTable (ExitGames.Client.Photon.StreamBuffer stream, ExitGames.Client.Photon.ParameterDictionary parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.PeerBase.SerializeOperationToMessage (System.Byte opCode, ExitGames.Client.Photon.ParameterDictionary parameters, ExitGames.Client.Photon.EgMessageType messageType, System.Boolean encrypt) [0x00000] in <00000000000000000000000000000000>:0 
  at ExitGames.Client.Photon.PhotonPeer.SendOperation (System.Byte operationCode, ExitGames.Client.Photon.ParameterDictionary operationParameters, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Realtime.LoadBalancingPeer.OpRaiseEvent (System.Byte eventCode, System.Object customEventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Realtime.LoadBalancingClient.OpRaiseEvent (System.Byte eventCode, System.Object customEventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonNetwork.RaiseEventInternal (System.Byte eventCode, System.Object eventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonNetwork.RPC (Photon.Pun.PhotonView view, System.String methodName, Photon.Pun.RpcTarget target, Photon.Realtime.Player player, System.Boolean encrypt, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonNetwork.RPC (Photon.Pun.PhotonView view, System.String methodName, Photon.Pun.RpcTarget target, System.Boolean encrypt, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at Photon.Pun.PhotonView.RPC (System.String methodName, Photon.Pun.RpcTarget target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at PhotonRPCController.OnHitNpcStaticMagicPostRetranslation (System.Collections.Hashtable eventParams) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Xml.Schema.XdrBuilder+XdrEndChildFunction.Invoke (System.Xml.Schema.XdrBuilder builder) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at SDKBoyEventManager.Update () [0x00000] in <00000000000000000000000000000000>:0

Please explain why this is so?

Thank you!

Comments

This discussion has been closed.