3

I'm trying to make the Play Game Services work, and for now, I'm trying a simple login attempt. And for full two days, I'm stuck in the authentication stage.

I've followed the documentation and tried to link my app from scratch again. double-checked my SHA-1 keys both the debug and the release. (there are two linked app in the Play Console). also checked that in the API Console everything is the same. When I check the result from the sign-in attempt I see: statusCode=SIGN_IN_REQUIRED.

Things that I checked or did:

  • SHA-1 keys
  • App Id correct and in the manifest
  • Correct Package
  • google-services.json downloaded
  • Link the app
  • Create a new app in the play console and new links
  • Firebase & Crashlytics is working
  • Enabled testing users

From the APK:

SHA-1 from the APK

From API console:

API Console

Play Console:

Play Console

Silent Login:

    private void signInSilently() {
        GoogleSignInOptions signInOptions = GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN;
        GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(context);
    if (GoogleSignIn.hasPermissions(account, signInOptions.getScopeArray())){
        GoogleSignInAccount signedInAccount = account;
        Log.d("TEST_SILENT", "onComplete: " + signedInAccount);
    } else {
        final GoogleSignInClient signInClient = GoogleSignIn.getClient(context, signInOptions);
        signInClient
                .silentSignIn()
                .addOnCompleteListener(
                        activity,
                        new OnCompleteListener<GoogleSignInAccount>() {
                            @Override
                            public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
                                if (task.isSuccessful()) {
                                    GoogleSignInAccount signedInAccount = task.getResult();
                                    Log.d("TEST_SILENT", "onComplete: " + signedInAccount);
                                } else {
                                    Intent i = signInClient.getSignInIntent();
                                    activity.startActivityForResult(i, 9001);
                                }
                            }
                        });
    }
}


Interactive Login:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == 9001) {
        GoogleSignInResult res = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        if (res.isSuccess()) {
            Log.d("ASD", "onActivityResult: " + res.getSignInAccount());
        } else {
            Log.e("Asd", "onActivityResult: " + res.getStatus());
        }
    }
}

Added the APP ID

<meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="@string/app_id" />

No matter what I do, I just can't get it to sign in. And the status from the logcat is:

E/Asd: onActivityResult: Status{statusCode=SIGN_IN_REQUIRED, resolution=null}
Dima T.
  • 78
  • 5
  • ref:- [https://stackoverflow.com/questions/37185464/googleapiclient-onconnectionfailed-with-statuscode-sign-in-required][1] – Ajaya Tiwari Aug 14 '19 at 09:37
  • But I'm not using Drive API in the application... – Dima T. Aug 14 '19 at 09:48
  • 1
    Could be either an implementation or a configuration problem. If you use the gdx-gamesvcs lib to communicate with GPGS, you know for sure that the implementation is working. So just try using it. – MrStahlfelge Aug 14 '19 at 15:20
  • Now I know about the gdx-gamesvcs lib, That's awesome. But I tried a simple test to connect and still not working. something in the configuration I guess - But I can't find what. – Dima T. Aug 14 '19 at 19:48
  • @DimaT. I'm in the same boat. Did you solve it? – dor506 May 24 '20 at 19:32
  • unfortunately no, after a couple of days I released the game without the services since it was just a side project... – Dima T. May 26 '20 at 07:45
  • Please see this solution: https://stackoverflow.com/questions/54243804/statuscode-sign-in-required-resolution-null-only-developer-id-can-login-else-er. – Shi Chen Nov 14 '22 at 21:26

0 Answers0