This is everything I had to do in order to get my game on the google play store. If anyone here believes this guide could be a bit more clear please let me know and i can always change/update it. This process is a bit involved but not overly difficult.
I. Developer Account
You must create a Developer Account with google play before you can publish.
https://play.google.com/apps/publish/signup
You must accept the Agreement and pay the fee ($25) for a google play developer account (even if you are just doing this to learn the process I believe it’s entirely worth it.)
Setup your account with your developer name and all your custom account details.
II. Game Setup
Using the unity google play login information
Plugin Installation
To download the plugin, clone this Git repository into your file system (or download it as a ZIP file and unpack it). Then, look for the unitypackage file in the current-build directory:
current-build/GooglePlayGamesPluginForUnity-X.YY.ZZ.unitypackage
To install the plugin, simply open your game project in Unity and import that file into your project’s assets, as you would any other Unity package. This is accomplished through the Assets > Import Package > Custom Package menu item (you can also reach this menu it by right-clicking the Assets folder).
III. To Deploy on Android:
Android SDK
Android V4.0 or Higher
Google Play Services library, version 11.6 or above
Java SDK
what isn’t really covered is the build tools. You must rename/replace the build tools that is currently installed at:
C:\Users{YOUR USER}\AppData\Local\Android\Sdk\tools
to
C:\Users{YOUR USER}\AppData\Local\Android\Sdk\tools-bak
Go to this link
https://dl.google.com/android/repository/tools_r25.2.5-windows.zip
and install the 25.2.5 tools in the:
C:\Users\Aaron\AppData\Local\Android\Sdk\tools folder
Unity requires these tools to compile for mobile. Hopefully it will be fixed in a future update.
Next, make sure your current build platform is set to Android. From File > Build Settings… select Android and click Switch Platform. You should now see a new menu item was added under Window > Google Play Games. If you don’t see the new menu items, refresh the assets by clicking Assets > Refresh and try again.
Google Play isn’t necessarily required to put your game on google play, but this is critical if you want to use components such as a leaderboard or achievements. The GitHub site has a great walk through on how to set this up. As this is for publishing on google play I won’t be going over the coding of your game and how-to setup leaderboard or Achievements.
IV: GOOGLE SIGN-IN
The following script should be added very early in your game loading, such as your splash or game menu screen, presumably to an empty game object. This is also where you would add other services from google plus such as leaderboards or achievements. It can also handle saved games (See Below).
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
public class PlayGamesScript : MonoBehaviour {
void Start ()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); //Enable Saved Games here after .Builder(). <ENABLESAVED GAMES> .BUILD();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
PlayGamesPlatform.DebugLogEnabled = true;
ConnectToGoogleServices();
}
public void ConnectToGoogleServices()
{
Social.localUser.Authenticate((bool success) => {
//Handle Success or failure here
});
}
V: Google Play Services Setup for Unity
The following is pretty much a copy paste right from the Github documentation as it covers these steps very well.
Configure Your Game
To use the plugin, you must first configure your game in the Google Play Developer Console. Follow the instructions on creating a client ID. Be particularly careful when entering your package name and your certificate fingerprints, since mistakes on those screens can be difficult to recover from.
If you intend to use real-time or turn-based multiplayer in your game, remember to activate those features in the Google Play Developer Console when creating your application instances.
Copy the game resources from the console
Once you configure at least one resource (event, achievement, or leaderboard), copy the resource configuration from the Google Play Developer Console, and paste it into the setup configuration in Unity. To get the resources go to the Achievements tab, then click on “Get resources” on the bottom of the list.
click Get Resources
Then click the “Android section”.
Android Resources
Select all the contents of the resources window, and copy them to the clipboard.
Paste the game resources into the plugin setup dialog
Back in Unity, open the setup dialog Window > Google Play Games > Setup… > Android Setup
Enter the directory to save constants - Enter the folder for the constants file.
Constants class name - this is the name of the C# class to create, including namespace.
Resources Definition - paste the resource data from the Play Games console here.
Web client ID - this is the client ID of the linked web app. It is only needed if you have a web-based backend for your game and need a server auth code to be exchanged for an access token by the backend server, or if you need an id token for the player to make other, non-game, API calls.
The setup process will configure your game with the client id and generate a C# class that contains constants for each of your resources.
VI: Setting up your SHA1 Fingerprint
In the Unity editor open File -> Build Settings. Open Player Settings and in the inspector open the Publishing Setting tab.
Click on Create new keystore, then Browse keystore.
Save the file that is created, it should be in your project folder.
Enter a password.
In the Alias drop down, create a new key.
Fill in the form that pops up.
EVERY TIME YOU OPEN THE GAME, IN ORDER TO BUILD A NEW VERSION, YOU MUST PUT THE PASSWORD INTO THIS AREA FIRST OR IT CAN NOT AUTHENTICATE
Next, search your computer for keytool.exe. Usually here:
C:\Program Files\Java\jdk1.8.0_162\bin\keytool.exe
Open a terminal window in keytool’s folder and type the commands.
For example:
keytool -exportcert -alias examplealias -keystore D:\mygames\mygame\user.keystore -list -v.
You’ll be asked for the password.
go to:
https://console.developers.google.com
Click credentials on the left margin of your screen
Under OAuth 2.0 Client IDs you should see your game. Click the name and fill out the credentials on the following page. The Signing Certificate fingerprint is what you generated previously. The package name must match what you will put into Unity later.
VII: Enable Google Play App Signing
After you have created your google play developer account and paid the registration fee. You can enable app signing through your google play developer console.
Click Release Management >> App signing.
And under upload certificate enter your SHA-1 fingerprint.
VIII: Configuring Unity further
In the Unity editor open File -> Build Settings. Open Player Settings and in the inspector open the Other Setting tab.
This is where you will put in your company name, game name and icon. Also your package name that was mentioned earlier.
For every update you do you have to change the Version and Bundle Version Code or google play will not process the APK.
Now you are ready to setup your first release. GOOD LUCK!!!
