- Home /
Google Game Services Not workng
I have pretty much looked into all the forums for this, but I keep hitting a brick wall while using Game Services Unity Asset Package. Below is my code that I actually linked to an UI Panel. The panel contains an Image and Text UI objects, which I intend to use to display google play services data of the player, whenever they touch that panel. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using GooglePlayGames; using GooglePlayGames.BasicApi; using UnityEngine.SocialPlatforms; public class SignIn : MonoBehaviour, IPointerClickHandler { public Text userProfileName; public Image userImage; #region IPointerClickHandler implementation public void OnPointerClick(PointerEventData eventData) { Debug.Log("Clicking Works!!!"); PlayGamesPlatform.InitializeInstance(PlayGamesClientConfiguration.DefaultConfiguration); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); if (!Social.localUser.authenticated) { Social.localUser.Authenticate((bool success, System.String msg) => { // handle success or failure if (success) { Debug.Log("Login Sucessful"); Texture2D img = Social.localUser.image; userImage.GetComponent<Image>().sprite = Sprite.Create(img, new Rect(0.0f, 0.0f, img.width, img.height), new Vector2(0.5f, 0.5f), 100.0f); userProfileName.text = "Hello, " + Social.localUser.userName; } else { Debug.Log("Login Failed"); userProfileName.text = "Sign In failed!! Click here to try again"; } }); } else { Debug.Log("Already logged in. Displaying the details"); Texture2D img = Social.localUser.image; userImage.GetComponent<Image>().sprite = Sprite.Create(img, new Rect(0.0f, 0.0f, img.width, img.height), new Vector2(0.5f, 0.5f), 100.0f); userProfileName.text = "Hello, " + Social.localUser.userName; } } #endregion // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
The touch input works as I can see from errors popping up in logcat when I click on the UI Panel. These are the things I have already tried from other forums and questions.
Made sure the game services application is linked properly in developer console to the application and published
Downloaded the unity game services packages multiple times from github and deleted and re-imported the asset package multiple times
Made sure the xml from developer console is properly resolved in Unity
I had game services uninstall and install in andoid-sdk, a couple of times
Attached the log cat error message here ..
Sorry about the terrible formatting. $$anonymous$$y preview looked okay when I inserted the code :(
Your answer
Follow this Question
Related Questions
CommandInvokationFailure: Gradle build failed. 0 Answers
When I start my game on Android this crashes (google play problem) 0 Answers
Showing Google Play Game Leaderboard UI not working at all 4 Answers
Cant sign in from my build to google play 0 Answers
Google Play fails to connect on android 0 Answers