Google Play Games - problem with authentication

Hello,

I’m using Google Play Games plugin ( GitHub - playgameservices/play-games-plugin-for-unity: Google Play Games plugin for Unity ), version 0.9.11 (latest).

I’m not able to pass authentication step on Android, trying also on “Minimal” sample. The error I get from adb logcat is:

[Play Games Plugin DLL] 01/03/15 23:05:46 +01:00 DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED

In app I get a login prompt, then I am asked to accept licence agreement, and then after loading indicator it simply fails.

Anybody had similar problem? I was looking over internet for some solution but didn’t find anything.

Interesting fact may be that when trying to run setup from File → Play Games Android Setup, I get a warning:

“The version of your copy of Google Play Services Library Project could not be determined. Please make sure it is at least version 6111000. Continue?”

So maybe this is a hint. But when I checked in libproject\google-play-services_lib\res\values\version.xml, my version is 6587000

The warning is quite normal and shouldn’t affect your login process.

Anybody had such problem? If the warning is normal - that’s great, thanks for your answer. But still have no idea why I cannot authenticate.

the latest build of unity google plugin has issue. Try an older version.

Also check the sample scripts. One needs to call activate the plugin before using it .

@spotavi thanks for your answer.

As I said, I’ve tried on sample (Minimal), and also I’m sure I call activate, if you mean GooglePlayGames.PlayGamesPlatform.Activate() by that.

I’ve tried on 0.9.11 and 0.9.10, where the issue also occurs. I didn’t try on previous builds because I don’t get “Setup on Android/iOS” buttons on them, so I don’t know how to setup them.

So the problem is still pending.

Maybe this is the problem of Unity Free? Does this plugin work with free version?

Yes, it works with free. Dunno, what can be wrong. Have you initialized the project with the setup menu? Have you set a proper application ID and Bundle Identifier?

All I do is something along these lines:

void Start()
{
    PlayGamesPlatform.Activate();
}

void showHiScore()
{
    if (!Social.localUser.authenticated)
    {
        Social.localUser.Authenticate((bool success) =>
        {
            if (!success)
            {
                // Couldn't connect, should probably show an error
                Debug.Log("Logging in; Failed");

                return;
            }
        });
    }

    Social.Active.ShowLeaderboardUI();
}

I’ve found the reason why…
The build has to be signed with keystore, even if this is just a development build. And this is the solution to the problem.

1 Like

Hello,

I ran into the same issue but for me, I have signed the APK file with my release key and the problem was not solved. The authentication procress begins normally on my app (I have the Play Games pop-up and I must accept the app permission on my google account) but after, I see on the log the same error as SuperSharBan. I’ve tried to generate an Android Project to check if the AndroidManifest information are correct but the result project is totally corrupted.

Okay, I found the problem.

On the github repository of the plugin, I take this piece of code for the GPG initialization :

    PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
        // enables saving game progress.
        .EnableSavedGames()
        // registers a callback to handle game invitations received while the game is not running.
        .WithInvitationDelegate(this.Debug)
        // registers a callback for turn based match notifications received while the
        // game is not running.
        .WithMatchDelegate(this.Debug)
        .Build();
    PlayGamesPlatform.InitializeInstance(config);

The achievement report works very well when I removed this section in my init class on Unity. I think there is some issue in these lines but I don’t know where.

Moreover, I learned that I cannot set a custom percent value like 33.333. The value must be 0.0f for lock achievement and 100.0f for unlocking achievement. If you put a value greater than 0.0f, this value will be automatically considered to 100.0f. If you want to put custom steps on the achievement, you must use the increment achievement on the Google Play Console.

I got that problem too. It’s weird that if I let the plugin activate as its default, I can login and show Achievements and Leaderboard fine. But if I enable game cloud saving, I can not log in and got the same error log on android. There’s seems a problem with google play cloud saving. I also tried replace Google Play Service Lib with the older version, both 6111000 (v20) and the latest one (v22).

I got that problem too with unity 4.6.1f1 and GooglePlayGamesPlugin-0.9.11, is there a solution?

I am having issues with matchmaking for a turn based game. I can view the achievements but cannot connect two players,a created game skips status automatching. Not sure if this is related but searching for hours for a solution and nothing on the interwebs.

Hello Guys,

After 2 days of tests with Authentification problems, (ERROR_NOT_AUTHORIZED)
I spotted my mistake :
"PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.EnableSavedGames()
.Build();
"
I wrotted : “.EnableSavedGames()” but my game don’t use it in Google Play interface, so the error occured !
Simply removing it (for my part), and let’s rock n roll !

2 Likes

I had this problem as well, because I didn’t remember to add the user to the list of tester accounts in google play console.

7 Likes

thanks buddy, you saved my day.

oh my god i love you so much right now, thanks for ending a 3 day migraine!

We are having the same issue! Were you able to solve the issue?

I had the same problem. I used EnableSavedGames option in my configuration, but forgot to enable the option in the Google Play Developer Console. Hope this helps someone :slight_smile:

Late in the game but the EnableSavedGames fix helped me get things working (already had the test account set), thanks all! :slight_smile: