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

Google play games not working

Discussion in 'Android' started by leozaur, May 10, 2021.

  1. leozaur

    leozaur

    Joined:
    Jan 7, 2018
    Posts:
    22
    I have implemented google play games as the guide said. Attaching a script.
    The Login() method is accesed by button so the problem is not there. So when I click the login button screen turns gray a bit (smth looks happening), however the signing is not happening
    Code (CSharp):
    1. 2021.05.10 19:10:01.868 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] ViewPostIme pointer 0
    2. 2021.05.10 19:10:02.111 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] ViewPostIme pointer 1
    3. 2021.05.10 19:10:02.152 32031 32047 Info Unity Starting Auth with token client.
    4. 2021.05.10 19:10:02.152 32031 32047 Info Unity
    5. 2021.05.10 19:10:02.153 32031 32047 Info Unity  [Play Games Plugin 0.10.12] 05.10.21 19:10:02 +03:00 DEBUG: Activating PlayGamesPlatform.
    6. 2021.05.10 19:10:02.153 32031 32047 Info Unity
    7. 2021.05.10 19:10:02.153 32031 32047 Info Unity  [Play Games Plugin 0.10.12] 05.10.21 19:10:02 +03:00 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
    8. 2021.05.10 19:10:02.153 32031 32047 Info Unity
    9. 2021.05.10 19:10:02.153 32031 32047 Info Unity  [Play Games Plugin 0.10.12] 05.10.21 19:10:02 +03:00 DEBUG: Creating platform-specific Play Games client.
    10. 2021.05.10 19:10:02.153 32031 32047 Info Unity
    11. 2021.05.10 19:10:02.154 32031 32047 Info Unity  [Play Games Plugin 0.10.12] 05.10.21 19:10:02 +03:00 DEBUG: Creating Android IPlayGamesClient Client
    12. 2021.05.10 19:10:02.154 32031 32047 Info Unity
    13. 2021.05.10 19:10:02.160 32031 32047 Debug HelperFragment Creating fragment
    14. 2021.05.10 19:10:02.162 32031 32031 Debug HelperFragment onResume called
    15. 2021.05.10 19:10:02.163 32031 32031 Debug SignInRequest signIn
    16. 2021.05.10 19:10:02.163 32031 32031 Debug SignInRequest Building client for: 2e779e5 (a:false e:false i:false wc: 605613785063-ogmlqqtptsq3tkrv1cja601oql1jl65g.apps.googleusercontent.com f: false)
    17. 2021.05.10 19:10:02.189 32031 32031 Debug SignInRequest canReuseAccount: true
    18. 2021.05.10 19:10:02.193 32031 32031 Debug SignInRequest lastSignedInAccount is null
    19. 2021.05.10 19:10:02.194 32031 32031 Debug SignInRequest signInClient.silentSignIn
    20. 2021.05.10 19:10:02.790 32031 32031 Debug SignInRequest silentSignIn.onFailure
    21. 2021.05.10 19:10:02.921 32031 32221 Debug AudioTrack stop() called with 777216 frames delivered
    22. 2021.05.10 19:10:02.966 32031 32340 Debug OpenGLRenderer HWUI GL Pipeline
    23. 2021.05.10 19:10:02.969 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] setView = DecorView@317e45e[SignInHubActivity] TM=true MM=false
    24. 2021.05.10 19:10:02.970 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] MSG_WINDOW_FOCUS_CHANGED 0
    25. 2021.05.10 19:10:02.988 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] dispatchAttachedToWindow
    26. 2021.05.10 19:10:03.005 32031 32031 Verbose Surface sf_framedrop debug : 0x4f4c, game : false, logging : 0
    27. 2021.05.10 19:10:03.006 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] Relayout returned: old=[0,0][0,0] new=[0,0][1920,1080] result=0x7 surface={valid=true 531107602432} changed=true
    28. 2021.05.10 19:10:03.006 32031 32340 Info OpenGLRenderer Initialized EGL, version 1.4
    29. 2021.05.10 19:10:03.006 32031 32340 Debug OpenGLRenderer Swap behavior 2
    30. 2021.05.10 19:10:03.009 32031 32340 Debug libGLESv1 STS_GLApi : DTS, ODTC are not allowed for Package : com.IzGames.CrossWay
    31. 2021.05.10 19:10:03.016 32031 32340 Debug mali_winsys EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1920x1080]-format:1
    32. 2021.05.10 19:10:03.016 32031 32340 Debug OpenGLRenderer eglCreateWindowSurface = 0x7b68d2a230
    33. 2021.05.10 19:10:03.017 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] MSG_RESIZED: frame=Rect(0, 0 - 1920, 1080) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 72 - 0, 0) or=2
    34. 2021.05.10 19:10:03.017 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1920, 1080) ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=2
    35. 2021.05.10 19:10:03.070 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] Relayout returned: old=[0,0][1920,1080] new=[0,0][1920,1080] result=0x1 surface={valid=true 534902071296} changed=false
    36. 2021.05.10 19:10:03.289 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] MSG_WINDOW_FOCUS_CHANGED 1
    37. 2021.05.10 19:10:03.289 32031 32031 Verbose InputMethodManager Starting input: tba=android.view.inputmethod.EditorInfo@7854d0c nm : com.IzGames.CrossWay ic=null
    38. 2021.05.10 19:10:03.289 32031 32031 Info InputMethodManager startInputInner - mService.startInputOrWindowGainedFocus
    39. 2021.05.10 19:10:03.346 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] MSG_WINDOW_FOCUS_CHANGED 0
    40. 2021.05.10 19:10:03.347 32031 32031 Error SignInRequest Setting result error status code to: 16
    41. 2021.05.10 19:10:03.364 32031 32031 Info Unity Returning an error code.
    42. 2021.05.10 19:10:03.364 32031 32031 Info Unity
    43. 2021.05.10 19:10:03.368 32031 32031 Debug HelperFragment onResume called
    44. 2021.05.10 19:10:03.372 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] MSG_RESIZED: frame=Rect(0, 0 - 1920, 1080) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=2
    45. 2021.05.10 19:10:03.372 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] MSG_WINDOW_FOCUS_CHANGED 1
    46. 2021.05.10 19:10:03.373 32031 32031 Verbose InputMethodManager Starting input: tba=android.view.inputmethod.EditorInfo@379e86a nm : com.IzGames.CrossWay ic=null
    47. 2021.05.10 19:10:03.373 32031 32031 Info InputMethodManager startInputInner - mService.startInputOrWindowGainedFocus
    48. 2021.05.10 19:10:03.382 32031 32340 Debug OpenGLRenderer eglDestroySurface = 0x7b68d2a230
    49. 2021.05.10 19:10:03.386 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] Relayout returned: old=[0,0][1920,1080] new=[0,0][1920,1080] result=0x5 surface={valid=false 0} changed=true
    50. 2021.05.10 19:10:03.394 32031 32350 Debug AudioTrack Client defaulted notificationFrames to 1365 for frameCount 4096
    51. 2021.05.10 19:10:03.396 32031 32350 Warn AudioTrack Use of stream types is deprecated for operations other than volume control
    52. 2021.05.10 19:10:03.396 32031 32350 Warn AudioTrack See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case
    53. 2021.05.10 19:10:03.396 32031 32350 Info AudioTrack This process already got info. FadeIn[0] FadeOut[0] FadeInRing[0]
    54. 2021.05.10 19:10:03.404 32031 32031 Debug ViewRootImpl@1c95df6[UnityPlayerActivity] Relayout returned: old=[0,0][1920,1080] new=[0,0][1920,1080] result=0x1 surface={valid=true 534902071296} changed=false
    55. 2021.05.10 19:10:03.408 32031 32047 Debug ConnectivityManager requestNetwork; CallingUid : 10209, CallingPid : 32031
    56. 2021.05.10 19:10:03.410 32031 32031 Debug ViewRootImpl@f750999[SignInHubActivity] dispatchDetachedFromWindow
    57. 2021.05.10 19:10:03.410 32031 32031 Debug InputEventReceiver channel 'e0e0da2 com.IzGames.CrossWay/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (client)' ~ Disposing input event receiver.
    58. 2021.05.10 19:10:03.410 32031 32031 Debug InputEventReceiver channel 'e0e0da2 com.IzGames.CrossWay/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (client)' ~NativeInputEventReceiver.
    59. 2021.05.10 19:10:03.412 32031 32047 Error Unity Not signed
    60. 2021.05.10 19:10:03.412 32031 32047 Error Unity GamesServices:<Login>b__9_0(Boolean)
    61. 2021.05.10 19:10:03.412 32031 32047 Error Unity System.Action`1:Invoke(T)
    62. 2021.05.10 19:10:03.412 32031 32047 Error Unity System.Action`2:Invoke(T1, T2)
    63. 2021.05.10 19:10:03.412 32031 32047 Error Unity GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)
    64. 2021.05.10 19:10:03.412 32031 32047 Error Unity System.Action`1:Invoke(T)
    65. 2021.05.10 19:10:03.412 32031 32047 Error Unity System.Action`1:Invoke(T)
    66. 2021.05.10 19:10:03.412 32031 32047 Error Unity System.Action:Invoke()
    67. 2021.05.10 19:10:03.412 32031 32047 Error Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
    68. 2021.05.10 19:10:03.412 32031 32047 Error Unity
    69. 2021.05.10 19:10:03.443 32031 32047 Info Unity  [Play Games Plugin 0.10.12] 05.10.21 19:10:03 +03:00 DEBUG: Authentication canceled
    70. 2021.05.10 19:10:03.443 32031 32047 Info Unity
    71.  
    Thats from android logcast and that is script from unity
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.SocialPlatforms;
    5. using GooglePlayGames;
    6. using GooglePlayGames.BasicApi;
    7. public class GamesServices : MonoBehaviour
    8. {
    9.     public string achievement_reach_75_points = "CgkI5_-Ti9AREAIQAg";
    10.     public string leaderboard = "CgkI5_-Ti9AREAIQAA";
    11.     public string achievement_reach_100_points = "CgkI5_-Ti9AREAIQAw";
    12.     public string achievement_reach_50_points = "CgkI5_-Ti9AREAIQAQ";
    13.     public bool mainScene = false;
    14.     public bool once = false;
    15.     public bool logged = false;
    16.     // Start is called before the first frame update
    17.     void Awake()
    18.     {
    19.         int n = FindObjectsOfType<GamesServices>().Length;
    20.         if (n != 1)
    21.         {
    22.             Destroy(this.gameObject);
    23.         }
    24.         else
    25.         {
    26.             DontDestroyOnLoad(gameObject);
    27.         }
    28.        
    29.  
    30.     }
    31.     private void Start()
    32.     {
    33.        
    34.         Debug.Log(Social.localUser.authenticated);
    35.     }
    36.     // Update is called once per frame
    37.     public void Login()
    38.     {
    39. if (mainScene && !once)
    40.         {
    41.             PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().EnableSavedGames().Build();
    42.             PlayGamesPlatform.InitializeInstance(config);
    43.             PlayGamesPlatform.DebugLogEnabled = true;
    44.             PlayGamesPlatform.Activate();
    45.            
    46.             Social.localUser.Authenticate((bool success) =>
    47.             {
    48.                 if (success)
    49.                 {
    50.                     Debug.Log("Signed");
    51.                     ((GooglePlayGames.PlayGamesPlatform)Social.Active).SetGravityForPopups(Gravity.BOTTOM);
    52.                     logged = true;
    53.                 }
    54.                 else
    55.                 {
    56.                     Debug.LogError("Not signed");
    57.                     logged = false;
    58.                 }
    59.             });
    60.  
    61.            
    62.            
    63.          
    64.             once = true;
    65.         }
    66.     }
    67.     public void ReportScore()
    68.     {
    69.      
    70.             Social.ReportScore(PlayerPrefs.GetInt("Best"), leaderboard, (bool success) =>
    71.             {
    72.                 if (success)
    73.                 {
    74.                     Debug.Log("Success");
    75.                 }
    76.             });
    77.        
    78.     }
    79.     public void Achievement(string id, int score)
    80.     {
    81.      
    82.             if (PlayerPrefs.GetInt("Best") >= score && PlayerPrefs.GetInt(id) == 0)
    83.             {
    84.                 PlayerPrefs.SetInt(id, 1);
    85.                 Social.ReportProgress(id, 100.0f, (bool success) => { });
    86.             }
    87.             else
    88.             {
    89.                 return;
    90.             }
    91.        
    92.     }
    93.     public void ShowLeaderboard()
    94.     {
    95.      
    96.             Debug.Log("ShowimgLead");
    97.             Social.ShowLeaderboardUI();
    98.        
    99.     }
    100.     public void ShowAchievements()
    101.     {
    102.        
    103.      
    104.  
    105.             Debug.Log("ShowimgAchiv");
    106.             Social.ShowAchievementsUI();
    107.        
    108.     }
    109.    
    110. }
     
  2. msaqlainz

    msaqlainz

    Joined:
    Mar 6, 2023
    Posts:
    2
    You found any solution to this?