Search Unity

NullReferenceException: Object reference not set to an instance of an object. with No Stack Track

Discussion in 'Unity Cloud Diagnostics' started by sevensails, Nov 10, 2017.

  1. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    Hi!

    I have a lot of errors :

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

    But Performance Reporting does not show any stack trace for it, only the error message. It seems to be related only to Android Builds.

    Is there some way to investigate the reason for this problem?

    Thanks
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Same here
     
  3. thomasn_unity

    thomasn_unity

    Unity Technologies

    Joined:
    Jun 21, 2016
    Posts:
    60
    Hi, this is a known issue that sometimes occurs with the IL2CPP runtime. We haven't had a lot of luck reproducing it internally, so if you can submit a bug report with your project attached, that would be very helpful. Sorry for the inconvenience!
     
    ascavalcante80 likes this.
  4. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
  5. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hi there,

    I think I have the same problem :( I have a bunch of errors that are showing up in performance reporting -
    A null value was found where an object instance was required.
    I get nothing in the managed stack trace, I have the native stack but I can't really make anything of it, which is a shame because I feel it would be an easy error to fix if I just knew where it was happening...
    Does that sound like the same problem?

    P.
     
  6. ascavalcante80

    ascavalcante80

    Joined:
    Jun 28, 2018
    Posts:
    12
    I got this error on Unity 2018.3.0f2, I use a drag and drop to assert the Text value to the variable phoneDebug. I got this error, despite the facts it works properly. I'm trying to build it to Android

    Code (CSharp):
    1. public class LaunchManager : MonoBehaviourPunCallbacks
    2. {
    3.     public Text phoneDebug;
    4.     // this function is associated to the GameObject ConnectButton
    5.     public void ConnectToServer(){
    6.             if(!PhotonNetwork.IsConnected){
    7.             PhotonNetwork.ConnectUsingSettings();
    8.             phoneDebug.text = "New connection ready." ;
    9.         } else {
    10.             phoneDebug.text = "Already connected!" ;
    11.         }
    12.     }
    13.  
    14.     public override void OnConnectedToMaster(){
    15.         phoneDebug.text = PhotonNetwork.NickName + " is connected to Master" ;
    16.      }  
    17. }
    18.