Object reference not set to an instance of an object error.

Can someone help me debug this issue. It will work in editor but not on my mobile build.

Any advice where to start. Seemed to happen all of a sudden.

It seems to crash at every point "PhotonNetwork." is called. It might not be able to find the settings in the Resource folder maybe? Even though it exists.


NullReferenceException: Object reference not set to an instance of an object.

at Photon.Pun.PhotonNetwork.set_NickName (System.String value) [0x00000] in <00000000000000000000000000000000>:0 


NullReferenceException: Object reference not set to an instance of an object.

 at Photon.Pun.PhotonNetwork.StaticReset () [0x00000] in <00000000000000000000000000000000>:0 

 at Photon.Pun.PhotonNetwork..cctor () [0x00000] in <00000000000000000000000000000000>:0 

 at Com.Momas.NewRacer.NetworkManager.Awake () [0x00000] in <00000000000000000000000000000000>:0 

Rethrow as TypeInitializationException: The type initializer for 'Photon.Pun.PhotonNetwork' threw an exception.

 at Com.Momas.NewRacer.NetworkManager.Awake () [0x00000] in <00000000000000000000000000000000>:0 


Autoconnected Player Can't connect: Loading settings failed. ServerSettings asset must be in any 'Resources' folder as: PhotonServerSettings

Photon.Pun.PhotonNetwork:ConnectUsingSettings()

Com.Momas.NewRacer.NetworkManager:Connect()


Here is where I set the nickname of the player



Answers