I have been playing around with the new Google Play Games Services lately. It took me a while to setup everything to get the example projects running. Mostly because a did a lot of small mistakes. So therefore I have written a small checklist so someone else doesn’t have to experience that same result. Developing is fun, configuring is not :-).
Google have a nice quick start of this, you find it here: https://developers.google.com/games/services/android/quickstart
You have to upload your APK and setup the game service to the developer console.
Make sure your game service has the status "Ready for test".
It's not needed to publish the APK unless you want to distribute it (even beta versions need to be published).
In the game service you need to setup which accounts that should be able to test the service. How to do it: https://developers.google.com/games/services/console/testpub#enabling_accounts_for_testing
When you make changes in Developer Console, some (or all) changes takes a while before they are activated. This could take a couple of hours.
When linking your app to the game service you need to authorize the application. You you do this by specifying the SHA1 fingerprint of the certificate. You probably want to use the debug certificate, you find the key in Eclipse in Window-Preferences-Android-Build. You may also want to use your public certificate, you find this in the Export wizard in Eclipse. It's fine to setup two applications, one with debug and another with release certificate. If you don't do this properly you will get an "Unknown error" when you run the example applications. More information: https://developers.google.com/games/services/console/enabling
(7B) In the previous step I first only used my release certificate. To make it easy to debug I then make by release certificate to a debug certificate. This works, but it's better to setup a client with the debug certificate. If you still want to go this path, here is how you do it: https://stackoverflow.com/a/14018541/1883479
EDIT:
If you get a white screen in the events above, go to https://cloud.google.com/console and accept terms of service (only once pr Google-account).
After creation the OATH client IDs can be seen and deleted in the API console: https://console.developers.google.com/. The client IDs may stop working if a different certificate or multiple certificates are created for the same package name. Note that removal from GameServicesConsole does NOT remove OAUTH client ids from 'backend' (API Console). If the Games Services console does not permit entering a SHA-1 key its because there are keys in the API console you should delete. (The Google Game Services documentation in 7. does not mention this console expect as a means to fix the white screen problem).
Related
After generate signed APK (Release Version 1.0) ,i tried to test it in my phone but i get this message
Play Protect doesn't recognize this app's developer. Apps from unknown developers can sometimes be unsafe.
i don't know why i get it , i have released to many apps without problem, but in this one i get this message , i tried to create a new key-store also i tried to create a new project with different package name but i still facing the same issue.
How can i fix this?
I think it is just because you tried to install your app directly from APK, and the device or Play Protect can't verify your developer's ID. You can try to upload your apk to Google Play Store then install it from there to see if the problem still persists or not.
Google Play protect recognizes the developer from the signing key the app is signed with. You can learn more about App Signing here. Google Play protect gets this information from the key used to publish the App in Google Play.
Most new apps are enrolled in Google Play App Signing (Help article). You don't say whether yours is or not, but I suspect it is. That is a good thing - it lets Google Help you if you lose your signing key or it gets compromised.
To see what the experience will be for your users, the best thing to do is use an Internal Testing Track when you publish your app during development. The release process is almost instant. And it lets you get the exact same experience your users will get, as the app is downloaded from Google Play, signed with the same key, etc.
You can find more about Internal Test Tracks here.
At present, I can't able to get log in within Google Play Services within my unity game.
I was getting this kind of message in the debug log:
I have checked all points, I don't find anything wrong within that apart from SHA1 fingerprint.
Because in the debug log, I was getting different and when I have created the Play Services app within the Play Store dashboard, it was different.
At app creation time, I got this kind of SHA1 fingerprint.
SHA1 Fingerprint
6A:0B:64:BE:31:F1:5F:B0:E2:E4:C3:33:65:C7:31:6A:7B:A9:32:A7
Now give me some direction to sign in within Google Play games services. I want to use this for leaderboard setup.
I can able to sort out the problem my self so I am posting it here so that it becomes useful for other forum members and they can save their time and efforts.
The main reason, my KeyStore SHA1, and created Play Services App SHA1 was running different.
This document provides me a proper way to find the actual running problem.
Troubleshooting Issues in Your Android Game
For solution purpose, I have taken these two steps:
I have created new Client ID based on my KeyStore SHA1
Link Play Service App with newly created Client ID so I have created a new link up for this purpose.
After this, I run the same installed build of my Android phone and I can able to sign into Google Play Services account.
Our project has multiple android developers that all have access to the Google Play Console, in order to be able to publish APK updates from their respective computers.
As mentioned in the docs and this post here :
The apk must be signed with the same certificates as the previous version
Question:
Is there a way where first developer can share his certificate with second developer, such that second developer is able to publish APK updates to Google Play console?
So far I didn't see any mention of this in the docs or discussion
The initial release of the app was published by the first developer. Now, the second developer would like to publish some updates as well. However this seems to be blocked, such that only APKs signed from first developer's computer will be permitted for Update upload.
Update
For a more established team, I can see the cloud solution from the accepted answer working - but in our case, sharing the certificate file proved to be the most practical solution. It was clean, fast, and solved the requirement without otherwise adding any additional layers to the stack.
One way to deal with this is to use the Google Play App Signing function of the Developer Console. Your signing key can be stored with Google and secondary upload keys are used to generate the build.
When you upload the build, Google will re-sign it with the actual signing key. If another developer comes along, the upload key can be revoked and a new one generated but the actual signing key remains secure in Google-land.
See:
https://developer.android.com/studio/publish/app-signing.html
and:
https://support.google.com/googleplay/android-developer/answer/7384423
What are all the conditions satisfied by the APK to upload in play store?
like debug release,signed apk,keystore generation.and please explain them how to do?
A release build. So you should ensure you are not polluting the logcat with your debugging statements. Usually this will automatically be flagged off for you but you may (as I often did) use different forms of debug logging (eg with the NDK) which will need explicit deactivation.
You will need to sign your APK also. You can generate a key and keystore offline with your development tools (i.e. Android Studio, can't remember about Eclipse but (How do I generate a "Keystore" for Google Play?) should work in that instance).
When you register an account on the playstore you need to upload your public key. You can associate about 20 (IIRC) keys with an app's GMS profile, although that is not strictly required to upload an app in general it is one of the great benefits of a Play Store account. See https://developers.google.com/android/guides/setup for more on that.
Then if you are seeking financial reward, either via advertisemnet or direct sales you will need to provide your address.
For this service and also, I suspect, for the purposes of identity verification, Google require a one off registration fee of a princely $25.
When I'm using google play game services, should I use the ID:s you get when you export a application with debug keystore and key? I want to be able to debug the game services features during development, and later on, when the game is ready for release, I will export it via my own keystore and upload it again to the developer console. Or should I just use my own keystore from the beginning, though I believe I won't be able to debug it then?
Take a look at this documentation, and see the note:
Note: When you are ready to publish your app, you must create a new client ID in the Developer Console. You must then follow these steps again with your release signing certificate. For more information about signing applications, see Signing Your Application.
This means you will then have two client IDs, both your debug deployed app and the released app will able to connect to the game server.
i don't know 100% but if it works like Google Maps, you will have 2 keys one for debug and another for release.
Salut