Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

out of sync when onLoad new scene (FirebaseAuth)

Discussion in 'Editor & General Support' started by gonzalodelpalacio, Apr 2, 2018.

  1. gonzalodelpalacio

    gonzalodelpalacio

    Joined:
    Mar 10, 2018
    Posts:
    5
    hello, when I change scene when loging a user through firebaseAuth, it almost always gives the following error:
    Code (CSharp):
    1. InvalidOperationException: out of sync System.Collections.Generic.Dictionary`2+Enumerator[System.IntPtr,Firebase.Unity.FirebaseAuthService+UserRefreshState].VerifyState () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs:70) System.Collections.Generic.Dictionary`2+Enumerator[System.IntPtr,Firebase.Unity.FirebaseAuthService+UserRefreshState].MoveNext () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:835) Firebase.Unity.FirebaseAuthService.RefreshExpiredTokens (System.Object sender, System.EventArgs eventArgs) Firebase.Platform.FirebaseHandler.Update () Firebase.Platform.FirebaseMonoBehaviour.Update ()
    The code that i use in first scene is the following (i use the last firebaseAuth plugin):

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Firebase.Auth;
    5. using UnityEngine.UI;
    6. using UnityEngine.SceneManagement;
    7. using System;
    8.  
    9. public class Sign : MonoBehaviour
    10. {
    11.  
    12.     private Firebase.Auth.FirebaseAuth auth;
    13.  
    14.     void Start()
    15.     {
    16.         auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
    17.     }
    18.  
    19.  
    20.   }
    21.     public void SignUp(string email, string password, string DisplayName)
    22.     {
    23.         if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
    24.         {
    25.             //Error handling
    26.             return;
    27.         }
    28.  
    29.  
    30.     public void SignIn(string email, string password)
    31.     {
    32.         auth.SignInWithEmailAndPasswordAsync(email, password).ContinueWith(task =>
    33.         {
    34.             if (task.IsCanceled)
    35.             {
    36.                 Debug.LogError("SignInWithEmailAndPasswordAsync canceled.");
    37.                 return;
    38.             }
    39.             if (task.IsFaulted)
    40.             {
    41.                 Debug.LogError("SignInWithEmailAndPasswordAsync error: " + task.Exception);
    42.                // if (task.Exception.InnerExceptions.Count > 0)
    43.                     //UpdateErrorMessage(task.Exception.InnerExceptions[0].Message);
    44.                 return;
    45.             }
    46.  
    47.             FirebaseUser user = task.Result;
    48.             Debug.LogFormat("User signed in successfully: {0} ({1})",
    49.                 user.DisplayName, user.UserId);
    50.  
    51.         PlayerPrefs.SetString("player_uid", auth.CurrentUser.UserId);
    52.         PlayerPrefs.SetString("player_DisplayName", auth.CurrentUser.DisplayName);
    53.             SceneManager.LoadScene("Menu Principal");
    54.         });
    55.     }
    56. }


    I've tried everything, until I've emptied the new scene and nothing at all. Could someone help me?
     
    DatLy and tento3797 like this.
  2. tento3797

    tento3797

    Joined:
    Apr 10, 2018
    Posts:
    1
    I have the same problem too, after logging into my game, all the 3d object button will cause the game freeze but the 3d object button running well if user logging function is not include in the project.

    I decided to add a scene which having a a button for user to proceed to the game, and the error that exactly the same with above will prompted in console and all the 3d object button that suppose to retrieve data from firebase retrieve nothing to the scene.

    Please~~~~~~~ anyone can help???? I'm in a urgent of assignment deadline~~~~~~~~~~~ ORZ
     
  3. huyakinemota_unity

    huyakinemota_unity

    Joined:
    Feb 4, 2018
    Posts:
    3
    same problem here;
    i changed Api Compatibility Level back to .NET 2.0 and error disappeared
     
    Last edited: Apr 11, 2018
  4. Eewhukn

    Eewhukn

    Joined:
    Oct 25, 2016
    Posts:
    6
  5. DatLy

    DatLy

    Joined:
    Jul 16, 2018
    Posts:
    1
    i got the same issue, please help
     
  6. NigelNar

    NigelNar

    Joined:
    Jul 19, 2018
    Posts:
    1
    This like is not working...

    Any1 got a solution to this, having a similar issue here, where I am not able to go to the next scene with scenemanager or ShowPanel..

    Thanks in advance...