Unity using Google Play Games Services Plugin
This setup is for a absolut basic setup, using the Google Play Games Login only. Assuming you build your app from scratch.
💖 Health Check / Goal Project
Windows 10
Unity 2020.3.14f1 (07, August 2021)
Module: Android Build Support
Module: iOS Build Support (only to avoid a bug using the GPGS Plugin)
2D Template
Play Games Plugin for Unity 0.12.10
2D Mobile Android App
Minimum SDK: Android 30
Set up a Unity Project
Set up Android
Build Settings
Build Settings
Check
Build App Bundle (Google Play)
Click
Switch Platform
Project Settings
> Player
Project Settings
> Player
API Level 30 is manadatory due to newest google restrictions
Windows To update to API Level 30, ensure to run Unity Hub as administrator.
Other Settings
Identification
Override Default Package Name
> Check itOverride Default Package Name
> Set your<your.package.name>
Version
> Set your app version0.1.1
Bundle Version Code
> 1Minimum API Level
> Android 11.0 (API Level 30)
Configuration
Scripting Backend
> SelectIL2CPP
Target Architectures
> CheckARM64
If you use Google Managed Keys, there is no need to handle any Upload or App Signing Key.
Create your first
<myappbundle>.aab
bundleBuild Settings
>Build
USB Debugging: Setup
Setup USB Debugging with your OS (e.g. Android)
Install Unity Play Games Services Plugin
Install the latest Play Games Plugin For Unity in your Unity project.
Google Play Console App: Set up app
Create the App
Go to
Google Play Console
> Create App > Enter your<appName>
Select your default language
Choose app type (probably Game)
Choose
free app
orpaid app
Check both Checkboxes
Upload your .aab
Testing
>Internal Testing
Testers
> Add yourgoogle mail
as a test accountCreate new release
App Integrity
>Continue
This create the App Signing Key managed by google.
Accessible unter Setup
> Integrity
Testing
>Internal Testing
App Bundles
Upload your .aab bundle created by Unity
This first upload creates the upload key managed by google.
Testing
>Internal Testing
Save
>Review Release
>Start Rollout to Interal Testing
Testers
>Copy Link
Open Link (Google Play Store and install the app)
Ensure that you removed previous versions of this app on your mobile device.
From here on, you set up an empty Android app and made it avaiable for internal testing. No Google Play Services used yet.
Google Play Services Plugin: Setup
Install the GPGS Plugin for Unity.
Simply download the
.package
file and double click it while unity project is open
Apply Google Play Services Resource
Go to Google Play Console
>Your App
>Play Games Services
>Configuration
>Credentials
>Get resources
(on the right hand side)Copy its content
Unity
>Window
>Google Play Games
>Setup
>Android Setup ...
insert copied
resource content
Click
Setup
The resource file should look similar to the following:
As long as you don't use any services such as achievements or leaderboard, no constant file will be created.
Implement the code
Allow Unity with Java Access
Allow Unity with Java Access
Currently there is a bug with building the app. It demands access to JAVA which it should have.
Reload the JDK and SDK in Unity
To fix it, deselect the JDK and the SDK in Unity
> Preferences
, unselected them and then select them in order again. It will recompile and the build will run in most cases. In my case it didn't, hence I did the second solution.
Last updated
Was this helpful?