Cannot sign in to Google Play Services
Hi all,
I can't sign in to Google Play Services on my Android builds in Beta.
I've followed the instructions here: https://github.com/playgameservices/play-games-plugin-for-unity
I've copied and pasted the resource configuration into Android Setup, and Google Play Game Services says it has configured correctly.
I have a Sign In button I use to test this - which will make the Leaderboards and Achievements Button visible upon success:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class GPSActions : MonoBehaviour {
public Button leaderboardButton;
public Button achievementsButton;
// Use this for initialization
void Start () {
PlayGamesPlatform.Activate();
}
// Update is called once per frame
void Update()
{
}
public void GPSSignIn()
{
// authenticate user:
Social.localUser.Authenticate((bool success) =>
{
// handle success or failure
if (success)
{
Debug.Log("Authentication successful");
string userInfo = "Username: " + Social.localUser.userName +
"\nUser ID: " + Social.localUser.id +
"\nIsUnderage: " + Social.localUser.underage;
Debug.Log(userInfo);
achievementsButton.GetComponent<Button>().gameObject.SetActive(true);
leaderboardButton.GetComponent<Button>().gameObject.SetActive(true);
}
else
{
Debug.Log("Authentication failed");
}
});
}
However when I press 'Sign In' in my Android Beta, the Google Play Services window opens, the green circle rotates and then nothing happens. I have made sure to add my email address to the Google Play Developer Console list of testers.
Is there anything I'm missing in the code above?
Thanks in advance!
Leo
Answer by peaceofmind1188 · Mar 19, 2018 at 05:12 AM
I'm not even getting a green sign in window. Upload certificate is correct on API console, testers enabled, SDK is up to date, and keystores are set. I've tried every tutorial I could find and started a new application/linked app for each one. None of them gets any results. No green window for signing on ever pops up. If anyone is willing to help me out, i'd be so grateful!
I am having the same issue. Did you find a solution to this problem?
Yes I did! I found it shortly after I posted. For some reason when I imported GPS, it did not import all the required folders (and this happened every time). I can't remember specifically which ones it left out, but I went through the list and re-imported the folders that were missing from my project. Then went to Assets ->PlayServiceResolver ->AndroidResolver -> ForceResolve. Then everything worked as intended =). Hope this helps
I can not thank you enough! I feel like you're the only person who has written this answer on the internet and it was the only thing that fixed it. 3 days wasted...
Answer by jerryjr261 · May 28, 2017 at 08:14 PM
I had this issue and this is what worked for me
thanks you very much . If using Google Play App Signing , you need do it !
Thanks, Thanks, Thanks so much !!I was already giving up solving this problem I can not find the solution anywhere but that solved my problem! thank you so much!
Answer by SaurabhStudio · May 29, 2017 at 09:43 AM
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.Build();
PlayGamesPlatform.InitializeInstance(config);
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
just try this
Answer by tsondhi2006 · Jun 18, 2017 at 11:21 AM
I had the same issue, There were 2 keystores for my application...long story short...try to use the 1st keystore that you made if you have multiple keystores.
Answer by bitsacpce · Jun 19, 2018 at 07:30 AM
@peaceofmind1188 I am facing similar issues after properly configuring everything. were you able to solve the issue??
Yes I did! I found it shortly after I posted. For some reason when I imported GPS, it did not import all the required folders (and this happened every time). I can't remember specifically which ones it left out, but I went through the list and re-imported the folders that were missing from my project. Then went to Assets ->PlayServiceResolver ->AndroidResolver -> ForceResolve. Then everything worked as intended =). Hope this helps
Your answer
Follow this Question
Related Questions
Unity Android APK crashing on startup with GPlay Services 0 Answers
Google Play services and Admob issue 0 Answers
Google Play services error Execution failed for task ':transformClassesWithJarMergingForRelease'. 0 Answers
Google Play Games - Unable to sign in - load the player 0 Answers
2021.2.7: DownloadHandlerTexture and UnityWebRequestTexture not recognized? 1 Answer