This guide describes how to set up an Android Studio project to use the Play Games Services SDK. You must complete these steps before you set up Play Games Services sign-in and add Play Games Services features to your game.
Before you begin
To prepare your app, complete the steps in the following sections.
App prerequisites
Make sure that your app's build file uses the following values:
- A
minSdkVersion
of19
of higher - A
compileSdkVersion
of28
or higher
Set up your game in Google Play Console
The Google Play Console is where you manage Google Play games services for your game, and configure metadata for authorizing and authenticating your game. For more information, see Setting Up Google Play Games Services.
Configure your app
In your project-level build.gradle
file, include
Google's Maven repository
and Maven central repository
in both your buildscript
and allprojects
sections:
buildscript {
repositories {
google()
mavenCentral()
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
Add the Google Play services dependency for the Play Games SDK to your module's Gradle build file, which is commonly
app/build.gradle
:
dependencies {
implementation "com.google.android.gms:play-services-games-v2:+"
}
After completing these steps you must set up sign-in in order for the game to access Play Games Services features.