Hello everyone,
I am actually trying to get my application working together with a Firebase Realtime Database.
For some time getting the reference to the database worked fine. It is actually a quite simple line:
FirebaseDatabase.DefaultInstance.RootReference
But now it returns null and I do not have an idea why?!
private void InitializeFirebase()
{
Debug.Log("Initializing FirebaseManagerGame + DB");
try
{
DBreference = FirebaseDatabase.DefaultInstance.RootReference;
}
catch (Exception e)
{
Debug.Log("Gotacha! " + e.Message);
if (DBreference == null)
Debug.Log("DBreference is null");
throw e;
}
Output:
Gotacha! Object reference not set to an instance of an object
UnityEngine.Debug:Log (object)
FirebaseManagerGame:InitializeFirebase () (at Assets/Scripts/FirebaseManagerGame.cs:72)
FirebaseManagerGame:<Awake>b__4_0 (System.Threading.Tasks.Task`1<Firebase.DependencyStatus>) (at Assets/Scripts/FirebaseManagerGame.cs:44)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
DBreference is null
Do you have any idea why?
By the way: WIthout the try catch block I do not see any exception. It simply does not work and the exception is hidden, which does not really make it easy to find the problem…

How did you initialize the FirebaseApp instance? Did you use the config file from Firebase?
– Llama_w_2Ls