Android Unity - Firebase Console not showing any updates

43 Views Asked by At

I have installed Firebase in clean Unity Android project and it is not sending logs to Firebase console. There is no error in the Unity Console. Followed the official documentation.

I don't know if it is any bug and others also facing the same issue? I'm quite frustrated because I worked hard already for moving my project from 2020 to 2022 thinking that it will fix some bugs and compatibility issues.

Gradle was giving some issues which I solved by replacing "https" with "http" in gradle properties which then fixed the error in External Dependency Manager > Android Resolver > Force Resolve.

My project is already online based so I'm sure my project is able to access internet. Is there any chance the Firebase specifically is blocked to access internet or something? It is not showing in the Firewall though as I checked there. I also tried using one down version of Unity Firebase but still nothing in Firebase Console.

Current versions under my use are as below: Windows 10 Unity 2022.3.17f1 OpenJDK 11.0.14.1 Firebase Analytics Unity 11.6.0

Here is my script on an active GameObject for firebase initialization:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Firebase;
using Firebase.Analytics;

public class FirebaseStarter : MonoBehaviour
{
    public FirebaseApp app;
    // Start is called before the first frame update
    void Start()
    {
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                app = FirebaseApp.DefaultInstance;
                Debug.Log("Firebase Analytics reached.");

                // Set a flag here to indicate whether Firebase is ready to use by your app.
                
            }
            else
            {
                UnityEngine.Debug.LogError(System.String.Format(
                  "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
            }
        });
    }
}

Unity console is printing message "Firebase Analytics reached."

1

There are 1 best solutions below

1
Joe Spiro On

Please add using Firebase.Extensions; to your using statements at the top of your file and switching out ContinueWith to ContinueWithOnMainThread.

After doing that, enable debug mode, enable verbose logging and check the console response.

If that doesn't work consider reinvestigating your gradle resolution issues using the EDM4U troubleshooting guide.