Hello guys,
i finnaly have the time to work on my project again. After buying an asset in Unity Store i had to upgrade Unity to 2020.1.6f1 in order to use it.
Now i have an error on a script for logging in using Firebase Authentication.
public void SignUp(string username, string email, string password)
{
StartCoroutine(SignUpCoroutine(username, email, password));
}
private IEnumerator SignUpCoroutine(string username, string email, string password)
{
yield return new YieldTask(FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
{
var dependencyStatus = task.Result;
if (dependencyStatus == DependencyStatus.Available)
{
fAuth = Firebase.Auth.FirebaseAuth.DefaultInstance;
//FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
}
else
{
Debug.LogError(string.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
}
}));
yield return new YieldTask(fAuth.CreateUserWithEmailAndPasswordAsync(email, password).ContinueWith(task =>
{
if (task.IsCanceled)
{
Debug.LogError("CreateUserWithEmailAndPasswordAsync was canceled.");
return;
}
if (task.IsFaulted)
{
Debug.LogError("CreateUserWithEmailAndPasswordAsync encountered an error: " + task.Exception);
return;
}
signUp = true;
// Firebase user has been created.
Firebase.Auth.FirebaseUser newUser = task.Result;
Debug.LogFormat("Firebase user created successfully: {0} ({1})",
newUser.DisplayName, newUser.UserId);
}));
if(signUp)
{
databaseManager.SetUpDatabase(username, email);
SceneManager.LoadScene("MainMenuScene");
signUp = false;
}
}
The code above used to work but now it gives me the error:
System.Threading.Tasks.Task FirebaseApp.CheckAndFixDependenciesAsync()
Argument 1: cannot convert from System.Threading.Tasks.Task to System.Threading.Tasks.Task
Can anyone help me?
Thank you.