playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 953 forks source link

Canceled Error when logging in #3185

Closed SmutnyJan closed 1 year ago

SmutnyJan commented 1 year ago

Describe the bug Getting Canceled Error when trying to log in.

To Reproduce Steps to reproduce the behavior:

  1. Raise PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication) or PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication)

Expected behavior Expected SignInStatus.Success.

Observed behavior Getting SignInStatus.Canceled

Screenshots This is what I am getting in console: Bez názvu

My key, which I have found at Google Play Console -> Setup -> App Integrity -> App Signing is the same as the one on first screenshot. I've checked the app id aswell and it is correct. My package name is correct aswell . OAuth consent screen user type is set to External. Tester account is added aswell. Key in Google Cloud Platform is my upload key, so this is OK aswell I think. The strange thing is that when I build my app as APK, put it on my phone through USB, install it and run, everything is fine, I can log in. But once I download version from google play with internal testing (ABB file), I am getting error stated above.

Here is my code I am using to authenticate:

` public Text Log; // Start is called before the first frame update public void Start() { PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication); }

  // Update is called once per frame
  void Update()
  {

  }

  internal void ProcessAuthentication(SignInStatus status)
  {

      if (status == SignInStatus.Success)
      {
          // Continue with Play Games Services
          Log.text += "Success!!\n";
      }
      else
      {
          Log.text += "Error: " + status + "\n";

          // Disable your integration with Play Games Services or show a login button
          // to ask users to sign-in. Clicking it should call
          // PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
      }
  }

  public void ManuallyLogIn()
  {
      PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication);
  }

} `

Here is the full console output:

2022.08.25 02:22:45.507 602 602 Info CheckConsentV2Fragment Checking OAuth consent: requestedAccount [Account {name=j0hnnyda5.mail@gmail.com, type=com.google}], chosenAccount [Account {name=j0hnnyda5.mail@gmail.com, type=com.google}] [CONTEXT service_id=1 ] 2022.08.25 02:22:45.520 12197 12197 Debug BoundBrokerSvc onBind: Intent { act=com.google.android.gms.signin.service.INTERNAL_START id=identifierhack:3624b7fc-0ce9-4db0-b5d3-c6f0ed3114cd pkg=com.google.android.gms (has extras) } 2022.08.25 02:22:45.521 12197 12197 Debug BoundBrokerSvc Loading bound service for intent: Intent { act=com.google.android.gms.signin.service.INTERNAL_START id=identifierhack:3624b7fc-0ce9-4db0-b5d3-c6f0ed3114cd pkg=com.google.android.gms (has extras) } 2022.08.25 02:22:45.583 795 890 Info hwcomposer [HWCDisplay] [Display_0 (type:1)] fps:44.891594,dur:1002.41,max:184.24,min:9.77
2022.08.25 02:22:45.591 1822 2068 Debug MobileStatusTracker(1/1) onSignalStrengthsChanged signalStrength=SignalStrength:{mCdma=Invalid,mGsm=Invalid,mWcdma=Invalid,mTdscdma=Invalid,mLte=CellSignalStrengthLte: rssi=-97 rsrp=-97 rsrq=-10 rssnr=2 cqiTableIndex=2147483647 cqi=2147483647 ta=2147483647 level=4 parametersUseForLevel=0,mNr=Invalid,SignalBarInfo{ lteLevel=3 },rat=14,primary=CellSignalStrengthLte} level=3 2022.08.25 02:22:45.592 1423 1730 Info SemWifiServiceDetector Traff. tracking resumed 2022.08.25 02:22:45.593 1822 2068 Debug NetworkController SignalStrength from intent slotId=1 2022.08.25 02:22:45.742 11159 11571 Warn Auth [GetTokenResponse] No token found in response, service=oauth2:https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/games_lite [CONTEXT service_id=153 ] 2022.08.25 02:22:45.748 12197 12197 Debug BoundBrokerSvc onUnbind: Intent { act=com.google.android.gms.signin.service.INTERNAL_START id=identifierhack:3624b7fc-0ce9-4db0-b5d3-c6f0ed3114cd pkg=com.google.android.gms (has extras) } 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] DEVELOPER_ERROR 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] This is usually caused by one of these reasons: 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] (1) Your package name and certificate fingerprint do not match 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] the client ID you registered in Developer Console. 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] (2) Your App ID was incorrectly entered. 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] (3) Your game settings have not been published and you are 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] trying to log in with an account that is not listed as 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] a test account. 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] (4) A server auth code was requested, but an incorrect client 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] id was provided. The client id for server auth codes should 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] be the client id for the game server (not the android app). 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] To help you debug, here is the information about this app 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] Package name : com.ITJ0hnny.OneMoreTime 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] Cert SHA1 fingerprint: 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] App ID from manifest : 531961327156 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] Check that the above information matches your setup in 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] Developer Console. Also, check that you're logging in with the 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] right account (it should be listed in the Testers section if 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] your project is not yet published). 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] For more information, refer to the troubleshooting guide: 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] http://developers.google.com/games/services/android/troubleshooting 2022.08.25 02:22:45.757 12197 32369 Error PlayGamesServices[SignInAuthenticator] 2022.08.25 02:22:45.768 602 602 Warn CheckConsentV2Fragment OAuth2 consent check failed [8] [CONTEXT service_id=1 ] 2022.08.25 02:22:45.772 602 602 Info SignInChimeraActivity Transitioning from state [6] to [11] [CONTEXT service_id=1 ] 2022.08.25 02:22:45.772 602 602 Warn SignInChimeraActivity Sign-in failed with code [10002] in state [6] [CONTEXT service_id=1 ]

Versions

At this point I am absolutely clueless since I've not been able to find any tutorial or guide on how to post app with game services to google play store. Thank you all for help.

MatiBianchi commented 1 year ago

This behavior is happening to me very often in google accounts that do not have a play games account associated. The nickname creation pop up is not being shown and the login status is the one mentioned in this issue.

SmutnyJan commented 1 year ago

The problem was that I had wrong sign keys stated in credentials. I've used upload key instead of signing key. Key in Google Cloud -> Credentials must match Setup -> App Integrity -> App Signing -> App signing key. I've copy pasted signing key into credentials and everything started working... So I don't know if this is right approach, but it worked...

tmhieu2893 commented 1 year ago

thanks for your solution @SmutnyJan you saved my day bro!