So I’m trying to implement a leaderboard and have successfully (as far as I can tell) implemented the Google Play Services plugin. I’ve also setup my leaderboard as instructed in the Google Play developer console.
On my main menu, I’ve created a login button which uses the ‘LogIn’ function as shown here :-
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class GooglePlayAuth : MonoBehaviour
{
#region PUBLIC_VAR
public string leaderboard;
#endregion
#region DEFAULT_UNITY_CALLBACKS
void Start()
{
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
}
#endregion
#region BUTTON_CALLBACKS
/// <summary>
/// Login In Into Your Google+ Account
/// </summary>
public void LogIn()
{
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
Debug.Log("Login Sucess");
}
else
{
Debug.Log("Login failed");
}
});
}
However, upon building,running and pressing the button on my device, the game hangs for a couple of seconds before crashing.
Hi, I have the same problem. The worst part is that I cannot get any detail of the crash. There are no debug or error log messages and don’t know how to debug it. Here is my console output:
Found dependencies:
com.android.support:support-annotations required by (this app)
com.google.android.gms:play-services-base required by (com.google.android.gms:play-services-games:9+, com.google.android.gms:play-services-drive:10.2.0)
com.google.android.gms:play-services-basement required by (com.google.android.gms:play-services-games:9+, com.google.android.gms:play-services-base:10.2.0, com.google.android.gms:play-services-tasks:10.2.0)
com.google.android.gms:play-services-drive required by (com.google.android.gms:play-services-games:9+)
com.google.android.gms:play-services-tasks required by (com.google.android.gms:play-services-games:9+, com.google.android.gms:play-services-base:10.2.0)
com.google.android.gms:play-services-auth-base required by (com.google.android.gms:play-services-auth:9+)
com.android.support:support-annotations required by (com.android.support:support-v4:23.1+, com.android.support:support-v4:24.0.0)
com.android.support:support-v4 required by (com.google.android.gms:play-services-basement:10.2.0)
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.JarResolver.PlayServicesSupport:Log(String, Boolean)
Google.JarResolver.PlayServicesSupport:ResolveDependencies(Boolean, String)
GooglePlayServices.ResolverVer1_1:DoResolutionNoAndroidPackageChecks(PlayServicesSupport, String, OverwriteConfirmation)
GooglePlayServices.<DoResolution>c__AnonStorey5:<>m__8()
GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
GooglePlayServices.PlayServicesResolver:Resolve(Action)
GooglePlayServices.PlayServicesResolver:AutoResolve()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorApplicationBindings.gen.cs:197)
(Filename: C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs Line: 197)
WARNING: No compatible versions of com.android.support:support-annotations required by (com.android.support:support-v4:23.1+, com.android.support:support-v4:24.0.0), will try using the latest version 24.0.0
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.JarResolver.PlayServicesSupport:Log(String, Boolean)
Google.JarResolver.PlayServicesSupport:ResolveDependencies(Boolean, String)
GooglePlayServices.ResolverVer1_1:DoResolutionNoAndroidPackageChecks(PlayServicesSupport, String, OverwriteConfirmation)
GooglePlayServices.<DoResolution>c__AnonStorey5:<>m__8()
GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
GooglePlayServices.PlayServicesResolver:Resolve(Action)
GooglePlayServices.PlayServicesResolver:AutoResolve()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorApplicationBindings.gen.cs:197)
(Filename: C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs Line: 197)