Search Unity

Firebase hangs the editor

Discussion in 'Editor & General Support' started by bz_apps, Jan 26, 2021.

  1. bz_apps

    bz_apps

    Joined:
    Aug 19, 2014
    Posts:
    70
    Hi,

    Im trying to set up FIrebase Analytics but the first method calls cause Unity to hang. Does anyone have any ideas?

    I using unity 2020.1.17f.

    I have the google apis installed via the Package Manager:
    App Core 7.0.2
    Analytics 7.0.2
    Crashlytics 7.0.2

    The first bit works:
    Code (CSharp):
    1. FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
    2.         {
    3.             m_dependencyStatus = task.Result;
    4.  
    5.             if (m_dependencyStatus == DependencyStatus.Available)
    6.             {
    7.                 InitializeFirebase();
    8.             }
    9.             else
    10.             {
    11.                 Debug.LogError($"Could not resolve all Firebase dependencies: {m_dependencyStatus}");
    12.             }
    13.         });
    but then in the InitializeFirebase, any calls to FIrebaseAnalytics cause it to hang.

    Code (CSharp):
    1.     private static void InitializeFirebase()
    2.     {
    3.         FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
    4.  
    5.         // Set default session duration values.
    6.         FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0));
    7.  
    8.  
    9.     }