playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.44k stars 959 forks source link

Unable to connect to Google Play even though everything is in order #3011

Open FerrinMass opened 3 years ago

FerrinMass commented 3 years ago

I am unable to connect to Google Play with GPG. I "Build and Run" from Unity, Android phone is connected through USB to the PC. Here's the log error:

PlayGamesServices[SignInAuthenticator]: APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES PlayGamesServices[SignInAuthenticator]: DEVELOPER_ERROR PlayGamesServices[SignInAuthenticator]: This is usually caused by one of these reasons: PlayGamesServices[SignInAuthenticator]: (1) Your package name and certificate fingerprint do not match PlayGamesServices[SignInAuthenticator]: the client ID you registered in Developer Console. PlayGamesServices[SignInAuthenticator]: (2) Your App ID was incorrectly entered. PlayGamesServices[SignInAuthenticator]: (3) Your game settings have not been published and you are PlayGamesServices[SignInAuthenticator]: trying to log in with an account that is not listed as PlayGamesServices[SignInAuthenticator]: a test account. PlayGamesServices[SignInAuthenticator]: PlayGamesServices[SignInAuthenticator]: To help you debug, here is the information about this app PlayGamesServices[SignInAuthenticator]: Package name : com.. PlayGamesServices[SignInAuthenticator]: Cert SHA1 fingerprint: 8C:C7:...:BD:D6 PlayGamesServices[SignInAuthenticator]: App ID from manifest : 86...64 PlayGamesServices[SignInAuthenticator]: PlayGamesServices[SignInAuthenticator]: Check that the above information matches your setup in PlayGamesServices[SignInAuthenticator]: Developer Console. Also, check that you're logging in with the PlayGamesServices[SignInAuthenticator]: right account (it should be listed in the Testers section if PlayGamesServices[SignInAuthenticator]: your project is not yet published). PlayGamesServices[SignInAuthenticator]: PlayGamesServices[SignInAuthenticator]: For more information, refer to the troubleshooting guide: PlayGamesServices[SignInAuthenticator]: http://developers.google.com/games/services/android/troubleshooting PlayGamesServices[SignInAuthenticator]: ****

Here are the screenshots that show everything is a match. I also added the correct email addresses to the "Testers" area (the one on my phone I use to login to Google Play). Sorry for the heavy redaction!!!

Google Cloud OAuth Play Game Services Config In-use SHA-1 Certificate Unity Android Setup

I have built time and again, restarted the Android, I did everything I could possibly think of. Still does not work. I get the above log error every single time.

From the log error, (1) and (2) can be checked off from those screenshots. (3) I'm not really sure what they mean by "game settings have not been published", but I filled everything in in the Console, so I think that's set. Also, I added my Google Play e-mail as tester, so that should be well taken care of.

Well, I'm not sure what else to do. Can... anyone please help? Thanks! I would really appreciate it as I am fully stuck!

nol0gic commented 3 years ago

Same here, except I'm downloading an internal test app from playstore testing link... the testers are added, the variables pointed in error info are 100% identical to the console ones, and my game services configuration is published... I'm already tried everything but with no luck...

nol0gic commented 3 years ago

Ok, seems like I've fixed this issue, can't say what exactly helped, but this is what I've done: renamed all *Names in credential settings to match my app name, and use this code for authentication instead: void Start() { PlayGamesPlatform.Activate(); Social.localUser.Authenticate(succes => { }); }

I may be wrong, but this problem can also be caused by running an app, not signed by google, try to download it from store to be sure...

OWL7seven commented 3 years ago

Ok, seems like I've fixed this issue, can't say what exactly helped, but this is what I've done: renamed all *Names in credential settings to match my app name, and use this code for authentication instead: void Start() { PlayGamesPlatform.Activate(); Social.localUser.Authenticate(succes => { }); }

I may be wrong, but this problem can also be caused by running an app, not signed by google, try to download it from store to be sure...

After struggling for a week., and literally tried everything known to man. this was the only way to make my game work and sign in.

i had used the standard system and it worked before, but for some magically reason it stopped working when i made the game more neater code wise, and didn't touch anything related to my gpg system. which made no sense. so going back and forth with my code repo. nothing worked.

but this does thank you!

OWL7seven commented 3 years ago

So this works - private void Start() { PlayGamesPlatform.Activate(); Social.localUser.Authenticate(succes => { }); }

And these dont - activation

public static void ActivateGooglePlayGames() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); Debug.Log("GPG - Activate - nocallback"); }

and this for sign in

PlayGamesPlatform.Instance.Authenticate(SignInCallback, showSignInOnTop);

does anyone know why?

TzeC94 commented 3 years ago

Ok, seems like I've fixed this issue, can't say what exactly helped, but this is what I've done: renamed all *Names in credential settings to match my app name, and use this code for authentication instead: void Start() { PlayGamesPlatform.Activate(); Social.localUser.Authenticate(succes => { }); }

I may be wrong, but this problem can also be caused by running an app, not signed by google, try to download it from store to be sure...

ya...apparently using Social.localUser.Authenticate work and I do remember they were using Social.LocalUser.Authenticate in the readme, then at some point they changed to PlayGamesPlatform.Instance.Authenticate which break the authentication services causing returning Developer Error

serge144 commented 3 years ago

Thanks alot for this guys. Just a question, will I have any problem in the future if I use Socia.localUser.Authenticate instead of PlayGamesPlatform.Instance.Authenticate(...)

OWL7seven commented 3 years ago

Thanks alot for this guys. Just a question, will I have any problem in the future if I use Socia.localUser.Authenticate instead of PlayGamesPlatform.Instance.Authenticate(...)

i think the only thing i seem to see, is the issue where the sign in banner cant be controlled anymore. meaning, we cant do silent sign in. or am i missing something,

FerrinMass commented 3 years ago

renamed all *Names in credential settings to match my app name

Hi, can you explain what that means? I'm not sure what that is... ???

OWL7seven commented 3 years ago

renamed

Hi, can you explain what that means? I'm not sure what that is... ???

i dont think that was the issue, its was the code change that fixed it, there are two methods to sign in, the one worked at one point but now not anymore (PlayGamesPlatform.Instance.Authenticate(SignInCallback, showSignInOnTop)).

"Social.localUser.Authenticate" is used now to log in after activating gpg

FerrinMass commented 3 years ago

renamed

Hi, can you explain what that means? I'm not sure what that is... ???

i dont think that was the issue, its was the code change that fixed it, there are two methods to sign in, the one worked at one point but now not anymore (PlayGamesPlatform.Instance.Authenticate(SignInCallback, showSignInOnTop)).

"Social.localUser.Authenticate" is used now to log in after activating gpg

Super, thanks, I'll give it a shot and see what happens! Many thanks!

FerrinMass commented 3 years ago

renamed

Hi, can you explain what that means? I'm not sure what that is... ???

i dont think that was the issue, its was the code change that fixed it, there are two methods to sign in, the one worked at one point but now not anymore (PlayGamesPlatform.Instance.Authenticate(SignInCallback, showSignInOnTop)).

"Social.localUser.Authenticate" is used now to log in after activating gpg

Hi, I'm a little confused here, how do you "activate" gpg? It seems with every new comment, there's new and surprising information coming out. I am not aware of anything that I need to do to activate it... Can you explain a bit more please? Thanks!

OWL7seven commented 3 years ago

its in the previous posts, when you look at the scripting refences on the google git page or maybe their website they show you everything you need to do. if you have the plugin in installed. you can just right click and check dependences , this will take you to the scripts that you need. they will have every method that you can call, as well as detailed descriptions of what they are used for, but based off your question most of the things i mention below you've known about so i ll just go through it again just in case.

but for now.... this activates google aka (gpg) aka google play games PlayGamesPlatform.Activate();

which is normally called on start. (this does things in the background that you wont see in game (except maybe the logs)) so just put that code in the start function of what ever script you have for google stuff.

now if you are just building from unity directly to your phone. you need to make sure you that you set up you google play services on your google play developer account . once that is done you'll have access to the client id (which is a line of text that you would use to put in the web client id found in the android setup window in unity)

now if you decided to let google handle your keystore, then you keystore in unity wont work with your gpg (hence nothing will work). you will need to either add that keystore client id (which you will need to generate yourself, there are tutorials on how to do that so just google it )to your google api concole or use the one google gives you.

the client id's in by the blue circle. the blue line is the one created by google, the black line is the keystore that i created in unity, and the rest with the black x you dont have to worry about cause that i created for other stuff that you wont have.

hope this give you enough info to understand, lol anything more then ima need to charge you XD

FerrinMass commented 3 years ago

now if you decided to let google handle your keystore, then you keystore in unity wont work with your gpg (hence nothing will work). you will need to either add that keystore client id (which you will need to generate yourself, there are tutorials on how to do that so just google it )to your google api concole or use the one google gives you.

Heh, well, thanks a lot for trying. Unfortunately I still don't understand why it fails. To me Google makes things excessively overwhelmingly complicated, and unnecessarily so (compare that to Steam, for example). I think the problem I'm having may be what I quoted in your reply. I think it is a keystore/id issue. I'm not sure what you mean by keystore client id, maybe you mean the SHA-1 cert fingerprint, which I tried both the one from Unity and the one from google. The result is the same. :(

OWL7seven commented 3 years ago

now if you decided to let google handle your keystore, then you keystore in unity wont work with your gpg (hence nothing will work). you will need to either add that keystore client id (which you will need to generate yourself, there are tutorials on how to do that so just google it )to your google api concole or use the one google gives you.

Heh, well, thanks a lot for trying. Unfortunately I still don't understand why it fails. To me Google makes things excessively overwhelmingly complicated, and unnecessarily so (compare that to Steam, for example). I think the problem I'm having may be what I quoted in your reply. I think it is a keystore/id issue. I'm not sure what you mean by keystore client id, maybe you mean the SHA-1 cert fingerprint, which I tried both the one from Unity and the one from google. The result is the same. :(

the keystore thing, where you use java and extract that out id/SHA-1 out of. and then use that and add it the google api?

FerrinMass commented 3 years ago

the keystore thing, where you use java and extract that out id/SHA-1 out of. and then use that and add it the google api?

not sure what that is.. what java thing?

OWL7seven commented 3 years ago

the keystore thing, where you use java and extract that out id/SHA-1 out of. and then use that and add it the google api?

not sure what that is.. what java thing?

here is a link that might help also explain before (link)

so you use java, which should be installed on your pc if you building for android, first you would need to...

  1. windows key and type "cmd" (command prompt) with admin (by right clicking on it)
  2. navigate to the jdk (java development kit) folder ( if you dont know how to do this, there are plenty of video which could show you how to use cmd in general)
  3. the you need to use " keytool -keypasswd -keystore keystoreFile -alias aliasName" in cmd (and replace what is needed with your data, try doing this in wordpad or something so long and you can just copy and paste in), and make sure the name and the location of the file is correct. if it will make it easier, maybe put it in the root of your c drive. after that you'll be given the SHA-1 fingerprint that you will then insert into your google api console for that title, after that it might take a while but you should have you it working at this point.

uhm just so that i understand you situation if you upload the apk to google and you download the app from whatever(internal/closed/open) track does google sign in work?

if its still not working, maybe hit me up on discord or something and i can have a look at it for you.

FerrinMass commented 3 years ago

the keystore thing, where you use java and extract that out id/SHA-1 out of. and then use that and add it the google api?

not sure what that is.. what java thing?

here is a link that might help also explain before (link)

so you use java, which should be installed on your pc if you building for android, first you would need to...

  1. windows key and type "cmd" (command prompt) with admin (by right clicking on it)
  2. navigate to the jdk (java development kit) folder ( if you dont know how to do this, there are plenty of video which could show you how to use cmd in general)
  3. the you need to use " keytool -keypasswd -keystore keystoreFile -alias aliasName" in cmd (and replace what is needed with your data, try doing this in wordpad or something so long and you can just copy and paste in), and make sure the name and the location of the file is correct. if it will make it easier, maybe put it in the root of your c drive. after that you'll be given the SHA-1 fingerprint that you will then insert into your google api console for that title, after that it might take a while but you should have you it working at this point.

uhm just so that i understand you situation if you upload the apk to google and you download the app from whatever(internal/closed/open) track does google sign in work?

if its still not working, maybe hit me up on discord or something and i can have a look at it for you.

ah yes, that i did do, it's part of the instructions... i think you are referring to the Upload key certificate... i tried that and the one from google... both do not work... :\

indeed, downloading the app from internal/closed/open does not work... in fact, i released the game as "single player" for the time being, and in production it doesnt work either... i may just keep it single player, i guess...?

OWL7seven commented 3 years ago

the keystore thing, where you use java and extract that out id/SHA-1 out of. and then use that and add it the google api?

not sure what that is.. what java thing?

here is a link that might help also explain before (link) so you use java, which should be installed on your pc if you building for android, first you would need to...

  1. windows key and type "cmd" (command prompt) with admin (by right clicking on it)
  2. navigate to the jdk (java development kit) folder ( if you dont know how to do this, there are plenty of video which could show you how to use cmd in general)
  3. the you need to use " keytool -keypasswd -keystore keystoreFile -alias aliasName" in cmd (and replace what is needed with your data, try doing this in wordpad or something so long and you can just copy and paste in), and make sure the name and the location of the file is correct. if it will make it easier, maybe put it in the root of your c drive. after that you'll be given the SHA-1 fingerprint that you will then insert into your google api console for that title, after that it might take a while but you should have you it working at this point.

uhm just so that i understand you situation if you upload the apk to google and you download the app from whatever(internal/closed/open) track does google sign in work? if its still not working, maybe hit me up on discord or something and i can have a look at it for you.

ah yes, that i did do, it's part of the instructions... i think you are referring to the Upload key certificate... i tried that and the one from google... both do not work... :\

indeed, downloading the app from internal/closed/open does not work... in fact, i released the game as "single player" for the time being, and in production it doesnt work either... i may just keep it single player, i guess...?

maybe let me help you check whats happening, because i just set up a new project and its working fine. i dont know how to dm here, but if you know how let me know, you can add me on discord or something.

metyildirim commented 3 years ago

I have fixed a similar problem, If you don't have a configuration error, this is a working example tested on Unity 2020.3 void Awake() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptOnce, (result) => {}); }