Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Google Play Game Services login issues
Started by greenrift Jun 06 2013 11:14 AM

- - - - -
44 replies to this topic
google gamenetwork game services login
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

funkyvisions

[GLOBAL: userInfoPane.html]
funkyvisions
  • Contributor

  • 105 posts
  • Corona SDK

I do think there is a bug however if you logout of Google Play from WITHIN the leaderboard window itself.  You can never get  it to show the scores again after that.  Chip Chain has exactly the same problem.  I'll probably open up a bug on it.



[TOPIC: post.html]
#27

rocking_vark

[GLOBAL: userInfoPane.html]
rocking_vark
  • Observer

  • 2 posts
  • Corona SDK

Hooray! I finally got mine to work.  But only for my production/release key.  I had to go back and make sure I checked "This app is preferred for new installations." for the entry I was using.  It still seems a little flakey, but I'll play around with it some more.

Hi, I am having the same problem and seems you have a solution, my question is what do you mean by  "had to go back and make sure I checked "This app is preferred for new installations." for the entry I was using."

 

1) "where can I check that?



[TOPIC: post.html]
#28

corona208

[GLOBAL: userInfoPane.html]
corona208
  • Observer

  • 8 posts
  • Corona SDK

Hi funkyvision, can u help me about Google Play Game Services sign-in problem. This type of error show on my android device "there was a sign-in issue." I implement all things correctly in correct place but error not finish. How i remove this error. if u send me ur own sample code of only GPGS whose full fledge functionality and error free....m really thankful to you....

 

I also check this link but it gives the same error of sign-in problem.....

 

https://github.com/coronalabs/plugins-sample-gameNetwork-google



[TOPIC: post.html]
#29

andershjarnaa

[GLOBAL: userInfoPane.html]
andershjarnaa
  • Enthusiast

  • 34 posts
  • Corona SDK

I had the same error, but got this resolved – at least now I’m logged in to game service, and can see my Leader Board.

 

I looked at this article, and found my SHA1 certificate fingerprint

https://developers.google.com/games/services/android/troubleshooting

 

You can find yours with this command:

keytool -exportcert -alias androiddebugkey -keystore debug.keystore -list -v

 

Just replace “androiddebugkey” and “debug.keystore”  with the name and filename of your keystore.

 

I then created a new Game Service Entity, and when I got to the SHA signing bit, I entered my SHA1 certificate fingerprint.

 

You DON’T need to publish the Game Service Entity, before you can test it. As long as your user signed in to the Phone is listed in the TESTING ACCESS area.



[TOPIC: post.html]
#30

corona208

[GLOBAL: userInfoPane.html]
corona208
  • Observer

  • 8 posts
  • Corona SDK

HI andershjarnaa ,

                             still i'm facing the same problem sign in error. I make three time keystore and SHA1 but SHA1 not match with package name. when i create SHA1 with this statement it generate error like this

 

keytool -exportcert -alias mytestapp -keystore mytestapp.keystore -list -v

 

$$$$$$$$$$$$$$$$$$$$ keytool -exportcert -alias mytestapp -keystore ~/.mytestapp.keystore -list -v
Enter keystore password:  
keytool error: java.lang.Exception: Alias <mytestapp> does not exist
java.lang.Exception: Alias <mytestapp> does not exist
    at sun.security.tools.KeyTool.doPrintEntry(KeyTool.java:1339)
    at sun.security.tools.KeyTool.doCommands(KeyTool.java:869)
    at sun.security.tools.KeyTool.run(KeyTool.java:172)
    at sun.security.tools.KeyTool.main(KeyTool.java:166)
 

can u help me about this problem.....m really thankful to you



[TOPIC: post.html]
#31

andershjarnaa

[GLOBAL: userInfoPane.html]
andershjarnaa
  • Enthusiast

  • 34 posts
  • Corona SDK

Hi corona208, I'm, not an expert in Java and the keytool at all, but it seems like there is a problem with the command you have entered. Are you sure that your certificate is called mytestapp?

Else I would suggest that you try and issue a new certificate from the beginning, and follow the process very carefully.

Have a look at this article to generate the keystore certificate.
http://developer.android.com/tools/publishing/app-signing.html

[TOPIC: post.html]
#32

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

@corona208, you might want to replace the alias mytestapp with mytestappalias.

 

Edit:  Actually, try this.

 

Launch Corona SDK > File > Build and select Android for your app.

 

It should bring up the popup screen that shows your application name, version code, etc. along with  your Keystore and Key Alias.

 

It should show mytestapp.keystore as the Keystore and something else for Key Alias.

 

So, let's say, your keystore is mytestapp.keystore and Key Alias is mytestappalias, then you change your command line like so:

 

Wrong one:

keytool -exportcert -alias mytestapp -keystore ~/.mytestapp.keystore -list -v

 

Right one:

keytool -exportcert -alias mytestappalias -keystore ~/.mytestapp.keystore -list -v

 

Naomi



[TOPIC: post.html]
#33

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,786 posts
  • Enterprise

Great answers @Naomi and @andershjarnaa



[TOPIC: post.html]
#34

corona208

[GLOBAL: userInfoPane.html]
corona208
  • Observer

  • 8 posts
  • Corona SDK

Hi andershjarnaa and Naomi,

 

 

 

I also try the same method as u telling keystore are generate successfully without problem with this command 

 

I'm on Mac

 

keytool -genkey -v -keystore testapp.keystore -alias testapp -keyalg RSA -validity 999999

 

 

 

answered all question and then generate keystore but when i am create SHA1 with this command 

 

keytool -exportcert -alias mytestappalias -keystore ~/.mytestapp.keystore -list -v

 

 

 

it gives error like this "Keystore file does not exist" m also give path within this command like as

 

keytool -exportcert -alias mytestappalias -keystore ~/.android/debug.keystore -list -v but it gives error

 

when I generate SHA1 with correct method then i solved all error. due to this error Google Play Game Service gives Sign-in error.

 

please help me how i remove this error. or tell me how i give the path init.

 

I read the whole article of GPGS service and implement accordingly to the document but still face the problem X_X :@

 

 

 

M right or not???

 

 

 

Bilal



[TOPIC: post.html]
#35

corona208

[GLOBAL: userInfoPane.html]
corona208
  • Observer

  • 8 posts
  • Corona SDK

Hi andershjarnaa and Naomi,

can anyone email me source code of working google play game service in which show leader board and achievements show. m really thankful to you.

email: bluebird786@gmail.com

Bilal

[TOPIC: post.html]
#36

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,786 posts
  • Enterprise

If you use:

 

keytool -genkey -v -keystore testapp.keystore -alias testapp -keyalg RSA -validity 999999

 

to generate the keystore, you would then use:

 

keytool -exportcert -alias testapp -keystore testapp.keystore -list -v

 

to get the SHA1 value.  Of course you have to be in the same folder that you were in when you created the keystore.



[TOPIC: post.html]
#37

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

@corona208, as Rob noted above, the -alias should be followed by the path to the alias and -keystore should be followed by the path to the keystore.  If you have not moved your keystore to any folder on your mac but left it on where it was generated, you don't need to add ~/. in front of the keystore.

 

About the fully working sample code for GPGS with leaderboard and achievements, you can find it here:

 

https://github.com/coronalabs/plugins-sample-gameNetwork-google

 

Edit:  A quick not to mention that you need to insert appropriate IDs from Google Play (because the sample code does not include them.)  It won't just work without inserting correct value.

 

Naomi



[TOPIC: post.html]
#38

corona208

[GLOBAL: userInfoPane.html]
corona208
  • Observer

  • 8 posts
  • Corona SDK

Hi Naomi & Rob,

 

              I track the error but not find solution still. when i run this command 

 

https://developers.google.com/games/services/android/troubleshooting

 

"unzip YourGame.apk"

 

key tool -printcert -file META-INF/CERT.RSA

 

CERT.RSA file not generate in apk. Therefore SHA1 mismatching and gives sign-in error. I trace the error with the help of eclipse. I also make the apk with the help of eclipse. In eclipse apk generate all files. but corona apk generate all files except CERT.RSA 

 

simple to say, In corona SDK apk CERT.RSA file is missing only.

 

anybody have solution of this problem? please share it



[TOPIC: post.html]
#39

corona208

[GLOBAL: userInfoPane.html]
corona208
  • Observer

  • 8 posts
  • Corona SDK

Hi funkyvisions, 

 

               how you get rid of this error. how your SHA1 are matched. when i used production/release key it create the apk successfully. when i extract the file from using this command

 

unzip YourGame.apk 

 

keytool -printcert -file META-INF/CERT.RSA

 

https://developers.google.com/games/services/android/troubleshooting

 

CERT.RSA file not create in corona apk so my SHA1 not match so therefore i face the problem the sign-in problem i think so you also face the same problem of SHA1. if you have any solution about this problem please help me

 

w8 for your reply



[TOPIC: post.html]
#40

michael37

[GLOBAL: userInfoPane.html]
michael37
  • Enthusiast

  • 90 posts
  • Corona SDK

A big THX to Naomi

it works now (my fault was that the app name and the keystore was not the same). sometime fingers are faster than the brain!

 

for all, if you like to restart the OAuth2 procedure the only way i found, was to delete the app in the google play game service and recreate a new entry with all the parameters, copy the new ID to your build.settings and make a new version.

 

Michael



[TOPIC: post.html]
#41

benny5

[GLOBAL: userInfoPane.html]
benny5
  • Enthusiast

  • 61 posts
  • Corona SDK

Does it work for everyone now? Thought I'd share the lessons I learned in case it helps anyone else. I didn't read everything above so I hope I'm not boring people. Anyway lessons learned:
 
1. Like someone mentioned: the client ID is ALWAYS incorrect the first time you link a game on the google play dev console. you can see the error if you go to the api console. It will be stated like this the first time:
 
XXXXXXXXXXX.apps.googleusercontent.com
 
but when you remove the client ID and the linked app from the dev console and redo the process again the api console will show a client ID in the following format instead:
 
XXXXXXXXXXX-YYYYYYYYYYYYYYYYYYYYYYYYYYYY.apps.googleusercontent.com instead. Stupid bug Google...!
 
Well, now it will work! Unless:
 
2. If you tried to sign-in when it was incorrectly configured like above, the phone will remember that in the cache for your app. Go to application management and clear the data/cache for your app and it will try to re-sign-in next time.
 
Hope this helps someone! I spent the better part of this day to get this to work. Finally got the plugin sample going just a few minutes ago!


[TOPIC: post.html]
#42

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

Hey, @benny5, about the client ID, I have one of my apps with XXXXXXXXXXX.apps.googleusercontent.com, and it has no issue signing in.  So the first client ID would not be always be incorrect.  I think there was something else that caused the client ID not to work right the first time you created one, but the second one was generated correctly.

 

When I linked my first app, it had issue with client ID and I had to go through cleaning process, and for that app, the client ID looks like XXXXXXXXXXX-YYYYYYYYYYYYYYYYYYYYYYYYYYYY.apps.googleusercontent.com, but for my second app (which is a separate product and has its own GPGS set up), the client ID looks like XXXXXXXXXXX.apps.googleusercontent.com, and that's the first client ID I created for this app.

 

Naomi



[TOPIC: post.html]
#43

benny5

[GLOBAL: userInfoPane.html]
benny5
  • Enthusiast

  • 61 posts
  • Corona SDK

Hey Naomi,

 

That's interesting. I made a second game and managed to login with the simpler type of client ID as well. I have no idea what's going on. But both seem to work under certain conditions.



[TOPIC: post.html]
#44

authorwjf

[GLOBAL: userInfoPane.html]
authorwjf
  • Enthusiast

  • 78 posts
  • Corona SDK

Has anyone had any issues with logging out and back into Google Game Services a second time within the same application session?  In other words I request initialization, and login and it works.  Then I log out which doesn't have a callback.  The next time I try to initialize and login I don't get any kind of callback.  I hooked the Android device up to ADB and didn't see anything in the logcat.  Perhaps you can only call initialize once thus after a log out I should only log in?  Any guidance would be appreciated.



[TOPIC: post.html]
#45

authorwjf

[GLOBAL: userInfoPane.html]
authorwjf
  • Enthusiast

  • 78 posts
  • Corona SDK

Just to answer my own question here in case anyone else has a similar issue, it appears that you need to keep track locally whether or not the app has called the init on game services.  Doing so a second time simply results in the call finishing but no callback.  So init game services, login, then if you logout skip straight to login by passing init.




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]