Google play services Authenticate giving "Authentication failed - developer error" for no reason

Hello, i’ve been trying to deal with a very strange issue for a day. My app cant login to Google Play Game Services and i dont understand why. Using Unity 2021.2.0f1 Here is the logcat

 Returning an error code.
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GooglePlayGames.Android.<>c__DisplayClass18_0:<Authenticate>b__0(Int32) (at D:\Unity\FileName\ProjectName\Assets\GooglePlayGames\Platforms\Android\AndroidClient.cs:177)
GooglePlayGames.Android.<>c__DisplayClass27_0:<DoFetchToken>b__0(AndroidJavaObject) (at D:\Unity\FileName\ProjectName\Assets\GooglePlayGames\Platforms\Android\AndroidTokenClient.cs:208)
GooglePlayGames.Android.ResultCallbackProxy:onResult(AndroidJavaObject) (at D:\Unity\FileName\ProjectName\Assets\GooglePlayGames\Platforms\Android\AndroidTokenClient.cs:282)
System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) (at \Users\bokken\buildslave\unity\build\Modules\AndroidJNI\AndroidJava.cs:96)
UnityEngine.AndroidJavaProxy
Unity IAP: Already recorded transaction cckmjadabbnolplbdfkgdaji.AO-J1OxWnLv5kiX_pT3IematXPhAaiU31wU9zDi5JRVISxyqgYRYc6pzAm0zNk3IkL2jRdvab4ERgV_Ff8jbPof7F7zJM73a5LmhZ2YWMRpXvTNVNAbH8Rw
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogWarning(String, Object)
UnityEngine.Purchasing.PurchasingManager:ProcessPurchaseIfNew(Product) (at D:\Unity\FileName\ProjectName\Library\PackageCache\com.unity.purchasing@4.0.3\Runtime\Purchasing\PurchasingManager.cs:251)
UnityEngine.Purchasing.PurchasingManager:ProcessPurchaseOnStart() (at D:\Unity\FileName\ProjectName\Library\PackageCache\com.unity.purchasing@4.0.3\Runtime\Purchasing\PurchasingManager.cs:228)
UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1) (at D:\Unity\FileName\ProjectName\Library\PackageCache\com.unity.purchasing@4.0.3\Runtime\Purchasing\PurchasingManager.cs:214)
UnityEngine.Purchasing.<>c__DisplayClass6_0:<OnProductsRetrieved>b__0() (at D:\Unity\FileName\ProjectName\Librar
  [Play Games Plugin 0.10.12] 11.05.21 16:45:51 +03:00 DEBUG: Authentication failed - developer error
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GooglePlayGames.OurUtils.<>c__DisplayClass8_0:<d>b__0() (at D:\Unity\FileName\ProjectName\Assets\GooglePlayGames\OurUtils\Logger.cs:47)
GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() (at D:\Unity\FileName\ProjectName\Assets\GooglePlayGames\OurUtils\PlayGamesHelperObject.cs:136)

I tried to solve issue:

  • Checked SHA1 fingerprint. Im building directly to android device with usb thats why im using “Upload certificate SHA-1” but i also tried to open internal test and used “App signing certificate SHA-1” and download game from store as a tester still not working.
  • Checked tester email
  • Saved Games are enabled

and lastly tried to build game with Unity 2020.3.0f1 same way, same code and same “Upload certificate SHA-1” and its worked. If you have an idea about this i would be very grateful if you could help.

*Edit some corrections on logcat

We have the same problem in some test devices.

Hello. Same error. I can’t understand problem. My old version in production (Google Play) work fine. It’s on new plugin version (updated from old 2017 unity version and 0.9.xx plugin)

We’ve been able to circumvent the issue by reverting back to version 0.10.11 of the GPGS plugin. For whatever reason, version 0.10.13 errors out with the same “Authentication failed - developer error”-message even though all our OAuth keys are unchanged and are still correctly configured. Hope this helps.

1 Like

Same here during a new integration with Unity 2019.4.30f1 and GPG plugin version 0.10.13 and 0.10.14 (available but not tagged as release).
As a side note, be sure to check the login flow in the documentation/readme as it was changed in the 0.10.13 and it does not use the Unity Social interface any more.

I’ll try downgrading, our other game was updated last year from 0.10.09 to 0.10.12 and everything went smoothly.

I’ve managed to fix this, plugin version 0.10.14 is needed (just tagged yesterday as new release), here’s more details on what I did:

  • Updated to plugin version 0.10.14
  • Double checked the exact position of project.properties which is “Assets\Plugins\Android\GooglePlayGamesManifest.androidlib”.
  • Manually updated the POM ( “Assets\GooglePlayGames\Editor\m2repository\com\google\games\gpgs-plugin-support\0.10.14\gpgs-plugin-support-0.10.14.pom”) to reflect latest dependencies changes in the project.
  • Manually fixed the generated “Assets\GooglePlayGames\Editor\GooglePlayGamesPlugin_v0.10.14.txt” using the correct path for project.properties
  • Created a new build checking for app_id in the Manifest to be sure about that as it’s mandatory for a correct implementation.

And here’s the thread discussion: Authentication fail: Returning error code, result: DeveloperError · Issue #3105 · playgameservices/play-games-plugin-for-unity · GitHub

I hope this can help :slight_smile:

2 Likes

This problem fixed for me after disable .RequestServerAuthCode
this was my code now:

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            //.RequestServerAuthCode(false /* Don't force refresh */)
            //.RequestIdToken()
            .Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();

this worked for me but it is spamming
AndroidJavaException: java.lang.NullPointerException: GoogleSignInAccount must not be null
however, the spamming did stopped and stated Authentication Succeeded

2022/11/26 16:19:50.119 4298 4298 Debug SignInRequest Signed-in with the last signed-in account.
2022/11/26 16:19:50.120 4298 4320 Error SignInRequest Setting result error status code to: 10
2022/11/26 16:19:50.120 4298 4320 Info Unity Returning an error code.
2022/11/26 16:19:50.120 4298 4320 Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
2022/11/26 16:19:50.120 4298 4320 Info Unity
2022/11/26 16:19:50.123 4298 4298 Error Unity AndroidJavaException: java.lang.NullPointerException: GoogleSignInAccount must not be null
2022/11/26 16:19:50.123 4298 4298 Error Unity java.lang.NullPointerException: GoogleSignInAccount must not be null
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.android.gms.common.internal.r.a(Unknown Source:9)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.android.gms.games.Games.getGamesClient(Unknown Source:2)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.unity3d.player.ReflectionHelper.a(Unknown Source:0)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source:31)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at $Proxy12.onResult(Unknown Source)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.games.bridge.TokenPendingResult.setStatus(Unknown Source:24)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.games.bridge.SignInRequest.setSuccess(Unknown Source:13)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.games.bridge.SignInRequest.access$000(Unknown Source:0)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.games.bridge.SignInRequest$1.onComplete(Unknown Source:17)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at com.google.android.gms.tasks.zzj.run(Unknown Source:23)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at android.os.Handler.handleCallback(Handler.java:938)
2022/11/26 16:19:50.123 4298 4298 Error Unity     at android.os.Handler.dis
2022/11/26 16:19:50.124 4298 4320 Info Unity  [Play Games Plugin 0.10.14] 11/26/22 16:19:50 -05:00 DEBUG: Authentication succeeded
2022/11/26 16:19:50.124 4298 4320 Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
2022/11/26 16:19:50.124 4298 4320 Info Unity

I used a Coroutine and it shows that it does fail initially when calling
PlayGamesPlatform.Instance.Authenticate(); thus it will fail during void Start()
```csharp
**using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SocialPlatforms;
using UnityEngine.UI;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using GooglePlayGames.BasicApi.SavedGame;

public class lw_google : MonoBehaviour
{

PlayGamesClientConfiguration config;

private bool mStandby = false;
private string mStandbyMessage;
private string _mStatus;
private bool   is_login = false;

public Text stat;

void Start() {


    config = new PlayGamesClientConfiguration.Builder()
        .EnableSavedGames()
        .RequestEmail()
        .Build();
        //.RequestServerAuthCode(false)
        //.RequestIdToken()

    PlayGamesPlatform.InitializeInstance(config);
    PlayGamesPlatform.DebugLogEnabled = true;
    PlayGamesPlatform.Activate();
    StartCoroutine(authenticate());

}

IEnumerator authenticate ( )
{
    while (! is_login) {
        PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptAlways, (code) =>
        {
            if (code == SignInStatus.Success) {
                stat.text = "Authenticated. Hello, " + Social.localUser.userName + "(" + Social.localUser.id + ")";
                is_login = true;
            } else {
                stat.text = "Failed to Authenticate: " + code;
                is_login = false;
            }
        });

        yield return null;
    }
  
}**

```