Closed SackMaggie closed 1 month ago
I think the warning Should not get null account
is coming from this line of code
In GoogleSignInImpl
line 145
Here's how I call Sign in
SignInSilently
is always false
public async Task<GoogleSignInInfo> SignInAsync()
{
try
{
if (!IsSupported())
throw new PlatformNotSupportedException();
SetGoogleConfiguration();
googleSignInTask = SignInSilently ? GoogleSignIn.DefaultInstance.SignInSilently() : GoogleSignIn.DefaultInstance.SignIn();
GoogleSignInUser googleSignInUser = (await googleSignInTask);
Debug.LogWarning(Newtonsoft.Json.JsonConvert.SerializeObject(googleSignInUser));
googleSignInInfoCache = new GoogleSignInInfo(googleSignInUser);
return googleSignInInfoCache;
}
catch (TaskCanceledException)
{
Debug.LogWarning("User canceled");
throw;
}
catch (GoogleSignIn.SignInException e)
{
Debug.LogError("Got Error: " + e.Status + " " + e.Message);
Debug.LogException(e);
throw e;
}
catch (Exception e)
{
throw e;
}
}
private void SetGoogleConfiguration()
{
GoogleSignIn.Configuration ??= new GoogleSignInConfiguration
{
WebClientId = WebClientId,
#if UNITY_EDITOR || UNITY_STANDALONE
ClientSecret = ClientSecret,
#endif
RequestIdToken = true,
RequestEmail = true,
UseGameSignIn = false,
};
}
Well, I think I should also log the result code too. But this problem most likely came from fingerprint config or webclientId config I think. It seem it didn't get the account which is the behaviour from that kind of problem
Have you try config fingerprint and webclientId in google cloud console? And did you put all fingerprint from your keystore and playstore keystore already?
Well, I think I should also log the result code too. But this problem most likely came from fingerprint config or webclientId config I think. It seem it didn't get the account which is the behaviour from that kind of problem
Have you try config fingerprint and webclientId in google cloud console? And did you put all fingerprint from your keystore and playstore keystore already?
Thanks, I've fixed the issue by adding new OAuth with type Android and config SHA-1 fingerprint just like you said.
When calling sign in the popup for select account appear but after select an account to sign in the error appear.
Changing to different google account -> nothing change
log signin_error_android.log
Environment Unity 2023.2.20 Editor
1c4a52e9183b6de4d0926b3ecf6fa035135ee300
which is lastest as of now.