Unity 5.5.4p4 with GPG for Unity crash on authentication
I'm using the latest personal Unity version, together with the latest version of GPG for Unity from Github. The moment I click Login or let the GPG login during start, my game crashes.
I've searching and tried so many things. What i've done so far:
Downgraded the sdk tool to 25.2.3/.5
Downgraded the plugins to play-services-*-10.0.1
Different way of using the authentication part. So far nothing worked for me.
My leaderboard code is the following:
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
using UnityEngine.UI;
using GooglePlayGames.BasicApi;
public class Leaderboard : MonoBehaviour
{
#region PUBLIC_VAR
public string leaderboard;
#endregion
#region DEFAULT_UNITY_CALLBACKS
void Awake()
{
Debug.Log ("!!! init");
//PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
}
void Start ()
{
Debug.Log("!!! Login called");
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
Debug.Log("Login Sucess");
}
else
{
Debug.Log("Login failed");
}
});
}
Does anyone have a suggestion what to do next? My game is available in Google Play Store under closed Alpha (with my email/account added). I'm testing on my own device.
I've tried so many things and already lost more than a day to get this to work.
Try this
void Start ()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();
PlayGamesPlatform.InitializeInstance (config);
PlayGamesPlatform.DebugLogEnabled = true; // check logs
PlayGamesPlatform.Activate ();
Social.localUser.Authenticate (success => {
if (success) {
Debug.Log ("SignIn successful");
} else {
Debug.Log ("SignIn failed");
}
});
}
Thanks for the suggestion. also this crashes my game upon login. I saw a comment about using Unity 5.6 beta. I'll give that a go and let you know if this worked.
Answer by Butnaru · Jan 30, 2019 at 10:55 PM
Maybe this will help you fix that error: GooglePlayGamesPlugin-0.9.59