09-07 10:59:28.508 12117-12176/? E/Unity: InvalidOperationException: Don't call Firebase functions before CheckDependencies has finished
at Firebase.FirebaseApp.ThrowIfCheckDependenciesRunning () [0x00000] in
at Firebase.FirebaseApp.GetInstance (System.String name) [0x00000] in
at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in
at Firebase.Auth.FirebaseAuth.get_DefaultInstance () [0x00000] in
at Manager.FirebaseManager.FirebaseAuthPlayGames () [0x00000] in
at Manager.FirebaseManager.
at GooglePlayGames.PlayGamesPlatform+
at GooglePlayGames.Native.NativeClient+
at GooglePlayGames.OurUtils.PlayGamesHelperObject.Update () [0x
Can you show the code that's causing this? Are you calling into Firebase functions before CheckDependencies has finished?
I have the same problem today and fixed with the next steps, my app uses Firebase Analitycs and Firebase Auth, from the quick start guide on each example the devs call this method
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {})
ok.. this is correct if you have only one part of Firebase running in you project, but in my case, im using two parts, so from Auth, i delete the duplicated call to Firebase.FirebaseApp.CheckAndFixDependenciesAsync() and just calling it in the Analitycs script.
Then when firebase ends it's configuration on the Analitycs script, i call my Auth script but just the function InitializeFirebaseAuth.
And that fix it for me, maybe it will help you.
thanks @kaozgaia! also solved my case :)
Sounds like folks on this thread can now use System.Threading.Tasks.Task :) .
Can we re-open this issue? We're facing the same crash, but with a small number of users only.
Firebase is used only in one place:
void Start() {
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available) {
InitFCM();
} else {
Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
}
public void InitFCM() {
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
// On Notification Click
#if UNITY_ANDROID
// On click notification listener
UTNotifications.Manager.Instance.OnNotificationClicked += (NotificationClicked) => {
if (NotificationClicked.userData != null) {
string notificationURL = NotificationClicked.userData["url"];
// If the URL in the notification is not null
if (notificationURL != null) {
DeepLinking.GoTo(notificationURL); // GO FOR IT
}
}
};
#endif
}
Hi @Sh3rawi
If you are experiencing this issue, can you create a new issue, and fill out all the info in the fields. It'll help us track down the problem you might be seeing.
Most helpful comment
I have the same problem today and fixed with the next steps, my app uses Firebase Analitycs and Firebase Auth, from the quick start guide on each example the devs call this method
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {})
ok.. this is correct if you have only one part of Firebase running in you project, but in my case, im using two parts, so from Auth, i delete the duplicated call to Firebase.FirebaseApp.CheckAndFixDependenciesAsync() and just calling it in the Analitycs script.
Then when firebase ends it's configuration on the Analitycs script, i call my Auth script but just the function InitializeFirebaseAuth.
And that fix it for me, maybe it will help you.