Unity 구글 로그인 실패 Case #1
Problem
원래 잘 되던 구글로그인이 라이브러리 업데이트 후 먹통이 됨
APK로 빌드 후 Phone에서 실행 시 아래와 같은 로그(Exception에러는 아님)
: Returning an error code.
: GooglePlayGames.Android.<>c__DisplayClass18_0:<Authenticate>b__0(Int32)
: System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
: UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
: UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
:
: ### Username:
: User ID:
: IsUnderage: True
: GoogleAuthManager:<SignInGoogle>b__2_0(Boolean)
: GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)
: GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
:
: ### 로그인 성공? : False
: GoogleAuthManager:<SignInGoogle>b__2_0(Boolean)
: GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)
: GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
public void SignInGoogle()
{
if (!Social.localUser.authenticated)
{
Social.localUser.Authenticate(success =>
{
var userInfo = "Username: " + Social.localUser.userName +
"\nUser ID: " + Social.localUser.id +
"\nIsUnderage: " + Social.localUser.underage;
Debug.Log ($"### {userInfo}");
Debug.Log($"### 로그인 성공? : {success}");
if (success) {
OnGoogleSignIn.Invoke(true);
}
else {
OnGoogleSignIn.Invoke(false);
}
});
}
}
Solution
사용버전
Unity 2021.3.14f1
GooglePlayGamesPlugin-0.10.14
GoogleMobileAds-v7.3.1.unitypackage
firebase_unity_sdk_10.3.0
(22. 12. 23 현재 거의 최신버전)