- Home /
Google Play Services - Authentication crash
Hi,
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.
Any help greatly appreciated :)
I solved it by downgrading Google Play Services version...with 10.2.0 game was crashing but works perfect with 10.1.0 :)
Same issue.
I found this forum thread https://github.com/playgameservices/play-games-plugin-for-unity/issues/1604 looks like the GooglePlayGames plugin is not compatible with the most recent Google Play Services (10.2.0). Some people seem to be having success rolling back to 10.0.1
I'm just moving my game to Android from iOS so all of the Android stuff is a bit new to me, I'm a little worried about fiddling around with different versions at the moment. Let me know if you try any of the thread suggestions on this and have success.
In your project assets>plugins>Android folder replace all play services aar files which have 10.2.0 in their name with the 10.0.1 ones ...that is what I did and it worked !
Thanks jvukovic this worked for me. Do you know the difference between 10.2.0 and 10.0.1?
For anyone who want to try this the steps are here https://github.com/playgameservices/play-games-plugin-for-unity/issues/1604 look for a post by tolgau about 7 comments down
Answer by Pille5 · Mar 12, 2017 at 07:27 PM
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)
The path C:/buildslave/... looks invalid. Any idea?
I solved it by downgrading Google Play Services version...with 10.2.0 game was crashing but works perfect with 10.1.0 :)
Answer by Fimiam · Aug 30, 2017 at 12:49 PM
I have the same problem with GooglePlayGamesPlugin-0.9.40 please help anyone! I tried overwrite files 10.0.1 version and other but it didn't help.